Commit ca3e0f60 authored by Jouke Witteveen's avatar Jouke Witteveen
Browse files

Cleanup src/network

quirk() is not used anymore, inarray() doesn't belong in src/network.
parent 6ed493ee
...@@ -94,6 +94,19 @@ function checkyesno() { ...@@ -94,6 +94,19 @@ function checkyesno() {
esac 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 ## Waits until a statement succeeds or a timeout occurs
# $1: timeout in seconds # $1: timeout in seconds
......
...@@ -238,28 +238,6 @@ profile_down() ...@@ -238,28 +238,6 @@ profile_down()
); return $? ); 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 # interface_down interface
# take interface down # take interface down
# #
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment