Project

General

Profile

Task #6743 » helpers.sh

Philipp Buehler, 06/01/2019 01:15 PM

 
isin() {
local _a=$1 _b

shift
for _b; do
[[ $_a == "$_b" ]] && return 0
done
return 1
}
get_ifs() {
local _if _iflist=$(ifconfig -C)

for _if in $(ifconfig "$@" 2>/dev/null | sed '/^[a-z]/!d;s/:.*//'); do
isin "${_if%%+([0-9])}" $_iflist || echo -n "$_if "
done
echo
}
(2-2/2)