blob: d9ef3d9addf3b9e27e6b7b03812a9f698015f6b3 (
plain)
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
|
#!/bin/sh
set_default_config()
{
local cfg="$1"
config_get type "$cfg" "type"
case $type in
atheros)
uci set freifunk.wifi_device.channel=1
uci set freifunk.wifi_device.diversity=0
uci set freifunk.wifi_device.txantenna=1
uci set freifunk.wifi_device.rxantenna=1
uci set freifunk.wifi_device.disabled=0
uci set freifunk.wifi_device.txpower=""
uci set freifunk.wifi_device.country=276
uci set freifunk.wifi_device.regdomain="0x37"
uci set freifunk.wifi_device.outdoor="1"
uci set freifunk.wifi_device.hwmode=11g
uci set freifunk.wifi_device.distance=1000
uci set freifunk.wifi_iface=defaults
uci set freifunk.wifi_iface.mode=adhoc
uci set freifunk.wifi_iface.bssid="02:CA:FF:EE:BA:BE"
uci set freifunk.wifi_iface.sw_merge=1
uci set freifunk.wifi_iface.mcast_rate=5500
uci set freifunk.wifi_iface.probereq=1
uci commit freifunk
;;
mac80211)
uci set freifunk.wifi_device.channel=1
uci set freifunk.wifi_device.diversity=""
uci set freifunk.wifi_device.disabled=0
uci set freifunk.wifi_device.txpower=""
uci set freifunk.wifi_device.country=DE
uci set freifunk.wifi_device.distance=1000
uci set freifunk.wifi_device.htmode='HT40-'
uci set freifunk.wifi_device.hwmode=11ng
uci set freifunk.wifi_iface=defaults
uci set freifunk.wifi_iface.mode=adhoc
uci set freifunk.wifi_iface.bssid="02:CA:FF:EE:BA:BE"
uci set freifunk.wifi_iface.sw_merge=""
uci commit freifunk
;;
broadcom)
uci set freifunk.wifi_device.channel=1
uci set freifunk.wifi_device.diversity=""
uci set freifunk.wifi_device.disabled=0
uci set freifunk.wifi_device.txpower=""
uci set freifunk.wifi_device.country=DE
uci set freifunk.wifi_device.txantenna=0
uci set freifunk.wifi_device.rxantenna=0
uci set freifunk.wifi_device.hwmode=11g
uci set freifunk.wifi_device.distance=1000
uci set freifunk.wifi_iface=defaults
uci set freifunk.wifi_iface.encryption=none
uci set freifunk.wifi_iface.mode=adhoc
uci set freifunk.wifi_iface.bssid="02:CA:FF:EE:BA:BE"
uci set freifunk.wifi_iface.sw_merge=""
uci commit freifunk
;;
esac
}
(
while true ; do
sleep 30
wifie=0
config_load wireless && wifie=1
if [ $wifie -eq 1 ] ; then
config_foreach set_default_config wifi-device
uci set freifunk.interface.dns="88.198.178.18 141.54.1.1 212.204.49.83 8.8.8.8 8.8.4.4"
uci commit freifunk
exit 0
fi
done
) >/dev/null &
|