mirror of
git://projects.qi-hardware.com/openwrt-xburst.git
synced 2024-09-12 07:08:03 +03:00
functions.sh: add a function for removing an item from a list in a shell variable
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@12024 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
parent
55abede518
commit
097b27145d
@ -24,6 +24,20 @@ append() {
|
|||||||
eval "export ${NO_EXPORT:+-n} -- \"$var=\${$var:+\${$var}\${value:+\$sep}}\$value\""
|
eval "export ${NO_EXPORT:+-n} -- \"$var=\${$var:+\${$var}\${value:+\$sep}}\$value\""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
list_remove() {
|
||||||
|
local var="$1"
|
||||||
|
local remove="$2"
|
||||||
|
local val
|
||||||
|
|
||||||
|
eval "val=\" \${$var} \""
|
||||||
|
val1="${val%% $remove *}"
|
||||||
|
[ "$val1" = "$val" ] && return
|
||||||
|
val2="${val##* $remove }"
|
||||||
|
[ "$val2" = "$val" ] && return
|
||||||
|
val="${val1## } ${val2%% }"
|
||||||
|
eval "export ${NO_EXPORT:+-n} -- \"$var=\$val\""
|
||||||
|
}
|
||||||
|
|
||||||
config_load() {
|
config_load() {
|
||||||
[ -n "$IPKG_INSTROOT" ] && return 0
|
[ -n "$IPKG_INSTROOT" ] && return 0
|
||||||
uci_load "$@"
|
uci_load "$@"
|
||||||
|
Loading…
Reference in New Issue
Block a user