mirror of
https://github.com/Doodle3D/doodle3d-firmware.git
synced 2024-12-22 11:03:48 +01:00
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:
parent
05bb813f29
commit
7397066ad9
@ -8,7 +8,7 @@ logger "$BUTTON pressed for $SEEN seconds"
|
|||||||
if [ "$SEEN" -lt 1 ]
|
if [ "$SEEN" -lt 1 ]
|
||||||
then
|
then
|
||||||
#see https://github.com/Doodle3D/doodle3d-firmware/blob/master/src/network/wlanconfig.lua#L188 for reference
|
#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" ];
|
if [ $(uci get wireless.@wifi-iface[0].mode) == "sta" ];
|
||||||
then
|
then
|
||||||
logger "switching to AP"
|
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 reorder wireless.@wifi-iface[0]=2 #reorder networks so last used config goes to the top again
|
||||||
uci commit #commit changes
|
uci commit #commit changes
|
||||||
/etc/init.d/network reload #reload network module so changes become effective
|
/etc/init.d/network reload #reload network module so changes become effective
|
||||||
|
echo "4|" > /tmp/networkstatus.txt
|
||||||
else
|
else
|
||||||
logger "switching to STA $(uci get wireless.@wifi-iface[0].mode)"
|
logger "switching to STA $(uci get wireless.@wifi-iface[0].mode)"
|
||||||
uci set wireless.@wifi-iface[0].disabled=1 #disable current config
|
uci set wireless.@wifi-iface[0].disabled=1 #disable current config
|
||||||
@ -42,5 +43,6 @@ then
|
|||||||
uci delete dhcp.wlan
|
uci delete dhcp.wlan
|
||||||
uci commit #commit changes
|
uci commit #commit changes
|
||||||
/etc/init.d/network reload #reload network module so changes become effective
|
/etc/init.d/network reload #reload network module so changes become effective
|
||||||
|
echo "2|" > /tmp/networkstatus.txt
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user