-
Notifications
You must be signed in to change notification settings - Fork 33
/
wifiResetAndReboot
34 lines (24 loc) · 920 Bytes
/
wifiResetAndReboot
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/sh
UCI="/sbin/uci"
ACCESS_POINT_NAME=`$UCI get "arduino.@arduino[0].access_point_wifi_name"`
if [ "x$ACCESS_POINT_NAME" = "x" ]
then
ACCESS_POINT_NAME="Arduino"
fi
$UCI set "wireless.radio0.channel=11"
$UCI set "wireless.@wifi-iface[0].mode=ap"
$UCI set "wireless.@wifi-iface[0].ssid=$ACCESS_POINT_NAME"
$UCI set "wireless.@wifi-iface[0].encryption=none"
$UCI delete "wireless.@wifi-iface[0].key"
$UCI delete "wireless.radio0.country"
$UCI set "network.lan.ipaddr=192.168.240.1"
$UCI set "network.lan.netmask=255.255.255.0"
$UCI set "network.lan.proto=static"
reset-mcu
PREVIOUS_DNSMASQ_IFACE_LIST=`$UCI get "dhcp.@dnsmasq[0].interface"`
$UCI del_list "dhcp.@dnsmasq[0].interface=$PREVIOUS_DNSMASQ_IFACE_LIST"
$UCI add_list "dhcp.@dnsmasq[0].interface=lo,wlan0"
#$UCI add_list "dhcp.@dnsmasq[0].address=/#/192.168.240.1"
$UCI commit
#/bin/sed -i "s/#C:192.168/C:192.168/g" /etc/httpd.conf
/sbin/reboot