diff options
Diffstat (limited to 'package')
-rwxr-xr-x | package/base-files/files/etc/functions.sh | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/package/base-files/files/etc/functions.sh b/package/base-files/files/etc/functions.sh index f4af4a857..01db77ce3 100755 --- a/package/base-files/files/etc/functions.sh +++ b/package/base-files/files/etc/functions.sh @@ -24,6 +24,15 @@ append() { eval "export ${NO_EXPORT:+-n} -- \"$var=\${$var:+\${$var}\${value:+\$sep}}\$value\"" } +list_contains() { + local var="$1" + local str="$2" + local val + + eval "val=\" \${$var} \"" + [ "${val%% $str *}" != "$val" ] +} + list_remove() { local var="$1" local remove="$2" |