Skip to content
Snippets Groups Projects
Commit d9805c4f authored by rubo77's avatar rubo77
Browse files

uci option -q must be first option now

parent e597cf90
No related branches found
No related tags found
No related merge requests found
#!/bin/sh #!/bin/sh
# only once every timeframe the SSID will change to OFFLINE (set to 1 minute to change every time the router gets offline) # only once every timeframe the SSID will change to OFFLINE (set to 1 minute to change every time the router gets offline)
MINUTES="$(uci get ssid-changer.settings.switch_timeframe -q)" MINUTES="$(uci -q get ssid-changer.settings.switch_timeframe)"
# the first few minutes directly after reboot within which an Offline-SSID always may be activated # the first few minutes directly after reboot within which an Offline-SSID always may be activated
: ${MINUTES:=1} : ${MINUTES:=1}
FIRST="$(uci get ssid-changer.settings.first -q)" FIRST="$(uci -q get ssid-changer.settings.first)"
# use something short to leave space for the nodename (no '~' allowed!) # use something short to leave space for the nodename (no '~' allowed!)
: ${FIRST:=5} : ${FIRST:=5}
PREFIX="$(uci get ssid-changer.settings.prefix -q)" PREFIX="$(uci -q get ssid-changer.settings.prefix)"
# generate the ssid with either 'nodename', 'mac' or to use only the prefix: 'none' # generate the ssid with either 'nodename', 'mac' or to use only the prefix: 'none'
: ${PREFIX:='FF_OFFLINE_'} : ${PREFIX:='FF_OFFLINE_'}
if [ "$(uci get ssid-changer.settings.enabled -q)" = '0' ]; then if [ "$(uci -q get ssid-changer.settings.enabled)" = '0' ]; then
DISABLED='1' DISABLED='1'
else else
DISABLED='0' DISABLED='0'
fi fi
SETTINGS_SUFFIX="$(uci get ssid-changer.settings.suffix -q)" SETTINGS_SUFFIX="$(uci -q get ssid-changer.settings.suffix)"
if [ $SETTINGS_SUFFIX = 'nodename' ]; then if [ $SETTINGS_SUFFIX = 'nodename' ]; then
SUFFIX="$(uname -n)" SUFFIX="$(uname -n)"
...@@ -33,7 +33,7 @@ if [ $SETTINGS_SUFFIX = 'nodename' ]; then ...@@ -33,7 +33,7 @@ if [ $SETTINGS_SUFFIX = 'nodename' ]; then
SUFFIX=${SUFFIX:0:$HALF}...${SUFFIX:$SKIP:${#SUFFIX}} SUFFIX=${SUFFIX:0:$HALF}...${SUFFIX:$SKIP:${#SUFFIX}}
fi fi
elif [ $SETTINGS_SUFFIX = 'mac' ]; then elif [ $SETTINGS_SUFFIX = 'mac' ]; then
SUFFIX="$(uci get network.bat0.macaddr -q)" SUFFIX="$(uci -q get network.bat0.macaddr)"
else else
# 'none' # 'none'
SUFFIX='' SUFFIX=''
...@@ -43,7 +43,7 @@ OFFLINE_SSID="$PREFIX$SUFFIX" ...@@ -43,7 +43,7 @@ OFFLINE_SSID="$PREFIX$SUFFIX"
# TODO: ffac tq limits has to be implemented here if enabled # TODO: ffac tq limits has to be implemented here if enabled
ONLINE_SSID="$(uci get wireless.client_radio0.ssid -q)" ONLINE_SSID="$(uci -q get wireless.client_radio0.ssid)"
# if for whatever reason ONLINE_SSID is NULL # if for whatever reason ONLINE_SSID is NULL
: ${ONLINE_SSID:="FREIFUNK"} : ${ONLINE_SSID:="FREIFUNK"}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment