Added doodle3d-client fix

now the status is correctly displayed in the web ui. currently the script works because it assumes certain things. would be nice if i can add some more checks to it.
This commit is contained in:
olijf 2016-04-05 17:22:37 +02:00
parent 05bb813f29
commit 7397066ad9
1 changed files with 3 additions and 1 deletions

View File

@ -8,7 +8,7 @@ logger "$BUTTON pressed for $SEEN seconds"
if [ "$SEEN" -lt 1 ]
then
#see https://github.com/Doodle3D/doodle3d-firmware/blob/master/src/network/wlanconfig.lua#L188 for reference
#check if network on top is enabled
#check if network on top is in STA mode
if [ $(uci get wireless.@wifi-iface[0].mode) == "sta" ];
then
logger "switching to AP"
@ -30,6 +30,7 @@ then
uci reorder wireless.@wifi-iface[0]=2 #reorder networks so last used config goes to the top again
uci commit #commit changes
/etc/init.d/network reload #reload network module so changes become effective
echo "4|" > /tmp/networkstatus.txt
else
logger "switching to STA $(uci get wireless.@wifi-iface[0].mode)"
uci set wireless.@wifi-iface[0].disabled=1 #disable current config
@ -42,5 +43,6 @@ then
uci delete dhcp.wlan
uci commit #commit changes
/etc/init.d/network reload #reload network module so changes become effective
echo "2|" > /tmp/networkstatus.txt
fi
fi