-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathw2
executable file
·49 lines (34 loc) · 881 Bytes
/
w2
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/sh
#load wifi driver
w1
# set this so that can connect to router at channel 13
iwpriv mlan0 regioncode 0x41
sleep 2
touch /server_upload_activated.txt
uaputl bss_stop
ifconfig mlan0 down
# buzzer -t 1
sleep 2
echo "get available router and update wep.conf or wpa.conf"
connect_router
var=$?
echo "var : $var"
#sleep 2
if [ "$var" -eq 0 ]; then
wpa_supplicant -i mlan0 -B -c /etc/wep.conf
elif [ "$var" -eq 1 ] || [ "$var" -eq 2 ]; then
wpa_supplicant -i mlan0 -B -c /etc/wpa.conf
else
echo "no available router"
buzzer -t 5
echo "exit now"
exit -1 #do not run udhcpc if router is not found
fi
iwpriv mlan0 htcapinfo 0x4020000
udhcpc -i mlan0 -s /etc/dhcp.script -h flucard -A 2 -T 1 -t 5
# buzzer -t 5
buzzer -t 1; sleep 0.25; buzzer -t 0
buzzer -t 1; sleep 0.25; buzzer -t 0
buzzer -t 1; sleep 0.25; buzzer -t 0
sleep 5
ifconfig >> /mnt/sd/log.txt