applications/luci-ffwizard: initial
[project/luci.git] / applications / luci-ffwizard / root / etc / uci-defaults / device-defaults
1 #!/bin/sh
2
3 set_default_config()
4 {
5 local cfg="$1"
6 config_get type "$cfg" "type"
7 case $type in
8 atheros)
9 uci set freifunk.wifi_device.channel=1
10 uci set freifunk.wifi_device.diversity=0
11 uci set freifunk.wifi_device.txantenna=1
12 uci set freifunk.wifi_device.rxantenna=1
13 uci set freifunk.wifi_device.disabled=0
14 uci set freifunk.wifi_device.txpower=""
15 uci set freifunk.wifi_device.country=276
16 uci set freifunk.wifi_device.regdomain="0x37"
17 uci set freifunk.wifi_device.outdoor="1"
18 uci set freifunk.wifi_device.hwmode=11g
19 uci set freifunk.wifi_device.distance=1000
20 uci set freifunk.wifi_iface=defaults
21 uci set freifunk.wifi_iface.mode=adhoc
22 uci set freifunk.wifi_iface.bssid="02:CA:FF:EE:BA:BE"
23 uci set freifunk.wifi_iface.sw_merge=1
24 uci set freifunk.wifi_iface.mcast_rate=5500
25 uci set freifunk.wifi_iface.probereq=1
26 uci commit freifunk
27 ;;
28 mac80211)
29 uci set freifunk.wifi_device.channel=1
30 uci set freifunk.wifi_device.diversity=""
31 uci set freifunk.wifi_device.disabled=0
32 uci set freifunk.wifi_device.txpower=""
33 uci set freifunk.wifi_device.country=DE
34 uci set freifunk.wifi_device.distance=1000
35 uci set freifunk.wifi_device.htmode='HT40-'
36 uci set freifunk.wifi_device.hwmode=11ng
37 uci set freifunk.wifi_iface=defaults
38 uci set freifunk.wifi_iface.mode=adhoc
39 uci set freifunk.wifi_iface.bssid="02:CA:FF:EE:BA:BE"
40 uci set freifunk.wifi_iface.sw_merge=""
41 uci commit freifunk
42 ;;
43 broadcom)
44 uci set freifunk.wifi_device.channel=1
45 uci set freifunk.wifi_device.diversity=""
46 uci set freifunk.wifi_device.disabled=0
47 uci set freifunk.wifi_device.txpower=""
48 uci set freifunk.wifi_device.country=DE
49 uci set freifunk.wifi_device.txantenna=0
50 uci set freifunk.wifi_device.rxantenna=0
51 uci set freifunk.wifi_device.hwmode=11g
52 uci set freifunk.wifi_device.distance=1000
53 uci set freifunk.wifi_iface=defaults
54 uci set freifunk.wifi_iface.encryption=none
55 uci set freifunk.wifi_iface.mode=adhoc
56 uci set freifunk.wifi_iface.bssid="02:CA:FF:EE:BA:BE"
57 uci set freifunk.wifi_iface.sw_merge=""
58 uci commit freifunk
59 ;;
60 esac
61 }
62
63
64
65 (
66 while true ; do
67 sleep 30
68 wifie=0
69
70 config_load wireless && wifie=1
71
72 if [ $wifie -eq 1 ] ; then
73 config_foreach set_default_config wifi-device
74
75 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"
76 uci commit freifunk
77 exit 0
78 fi
79 done
80 ) >/dev/null &