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