diff options
Diffstat (limited to 'functions')
-rw-r--r-- | functions | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -130,6 +130,20 @@ status() { fi } +# usage : in_array( $needle, $haystack ) +# return : 0 - found +# 1 - not found +# Copied from makepkg +in_array() { + local needle=$1; shift + [ -z "$1" ] && return 1 # Not Found + local item + for item in "$@"; do + [ "$item" = "$needle" ] && return 0 # Found + done + return 1 # Not Found +} + # daemons: add_daemon() { |