Skip to content

Commit

Permalink
gtw360: update reset scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
devbis committed Aug 7, 2024
1 parent dd8f340 commit fd4b840
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 0 deletions.
17 changes: 17 additions & 0 deletions target/linux/imx/base-files/etc/uci-defaults/70_start_ap
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,23 @@ case "$(board_name)" in
uci set firewall.@zone[1].network='wwan wan wan6'
uci commit firewall
;;
geniatech,gtw360 )
# create wwan zone as it is the default for scanned networks
uci set network.wwan='interface'
uci set network.wwan.proto='dhcp'
uci commit network

# and add wwan to wan zone in firewall
uci set firewall.@zone[1].network='wwan wan wan6'
uci commit firewall

uci delete wireless.@wifi-device[0].disabled
uci set wireless.@wifi-device[0].channel='1'
uci set wireless.@wifi-device[0].band='2g'
uci set wireless.@wifi-device[0].country='US'
uci delete wireless.@wifi-device[0].htmode
uci commit wireless
;;
esac

exit 0
44 changes: 44 additions & 0 deletions target/linux/imx/base-files/etc/uci-defaults/71_button_actions
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,50 @@ EOF
done
reboot
}
EOF
;;
geniatech,gtw360 )
cat << "EOF" > /usr/bin/reset_wifi_config
#!/bin/sh
{
rm -f /etc/config/network
/bin/config_generate generate_static_network
uci set network.wwan='interface'
uci set network.wwan.proto='dhcp'
uci commit network

rm -f /etc/config/wireless
wifi config
uci delete wireless.@wifi-device[0].disabled
uci set wireless.@wifi-device[0].channel='1'
uci set wireless.@wifi-device[0].band='2g'
uci set wireless.@wifi-device[0].country='US'
uci delete wireless.@wifi-device[0].htmode
uci commit wireless
ubus call network restart
for i in 1 2 3
do
echo 100 > /sys/class/leds/amber/brightness
sleep 1
echo 0 > /sys/class/leds/amber/brightness
sleep 1
done
}
EOF
cat << "EOF" > /usr/bin/reset_overlay
#!/bin/sh
{
rm -rf /overlay/upper/.* /overlay/upper/*

for i in 1 2 3
do
echo 100 > /sys/class/leds/blue/brightness
sleep 1
echo 0 > /sys/class/leds/blue/brightness
sleep 1
done
reboot
}
EOF
;;
esac
Expand Down

0 comments on commit fd4b840

Please sign in to comment.