diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/globals | 13 | ||||
-rw-r--r-- | src/network | 22 |
2 files changed, 13 insertions, 22 deletions
diff --git a/src/globals b/src/globals index 5278bdc..491f9d6 100644 --- a/src/globals +++ b/src/globals @@ -94,6 +94,19 @@ function checkyesno() { esac } +## Check if variable is a member of an array +# $1: the variable to find +# $2...: the array elements +function inarray() { + local item search="$1" + shift + for item in "$@"; do + if [[ "$item" == "$search" ]]; then + return 0 + fi + done + return 1 +} ## Waits until a statement succeeds or a timeout occurs # $1: timeout in seconds diff --git a/src/network b/src/network index 20cc4fd..91dc49c 100644 --- a/src/network +++ b/src/network @@ -238,28 +238,6 @@ profile_down() ); return $? } -## Check if variable is a member of an array -# $1: the variable to find -# $2...: the array elements -inarray() -{ - local item search="$1" - shift - for item in "$@"; do - if [[ "$item" == "$search" ]]; then - return 0 - fi - done - return 1 -} - -## Check if a given quirk is enabled -# $1: the quirk name -quirk() { - inarray "$1" "${QUIRKS[@]}" - return $? -} - # interface_down interface # take interface down # |