Replace funny block with something easy to digest

This commit is contained in:
Devin Teske
2016-12-12 18:24:41 +00:00
parent bede070805
commit 114a587e3b
+4 -13
View File
@@ -43,19 +43,10 @@ country_set()
# Setup what was selected
# NB: Do not change order of arguments (or regdomain will be ignored)
#
if [ "$2" ]; then
ifconfig_args="${ifconfig_args}country $2"
fi
if [ "$1" ]; then
if [ "$2" ]; then
ifconfig_args="${ifconfig_args} "
fi
ifconfig_args="${ifconfig_args}regdomain $1"
fi
if [ ! "$ifconfig_args" ]; then
# Nothing to do (everything was skipped)
return $SUCCESS
fi
[ "$2" ] && ifconfig_args="$ifconfig_args country $2"
[ "$1" ] && ifconfig_args="$ifconfig_args regdomain $1"
[ "$ifconfig_args" ] || return $SUCCESS # Nothing to do
ifconfig_args="${ifconfig_args# }"
# Regdomain/country cannot be applied while interface is running
iface_up=$( ifconfig -lu | grep -w $WLAN_IFACE )