Add support for Ubiquity Unifi AC LITE
parent
985794524f
commit
d39f95282b
@ -0,0 +1,9 @@
|
||||
PROFILE=ubnt-unifiac-lite
|
||||
FILES=files/ubnt-unifiac-lite
|
||||
COMMON_FILES=files/common/its
|
||||
PACKAGES='
|
||||
collectd
|
||||
collectd-mod-wireless
|
||||
collectd-mod-interface
|
||||
collectd-mod-load
|
||||
collectd-mod-network'
|
@ -0,0 +1,61 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
set -u
|
||||
|
||||
mac=$(cat /sys/class/net/wlan0/address)
|
||||
|
||||
hostname=
|
||||
channel_11a=
|
||||
channel_11g=
|
||||
if [ "$mac" = 60:e3:27:b8:16:ec ]; then
|
||||
hostname=cz-ap0
|
||||
channel_11g=6
|
||||
elif [ "$mac" = 60:e3:27:ed:86:9a ]; then
|
||||
hostname=cz-ap1
|
||||
channel_11g=11
|
||||
elif [ "$mac" = 78:8a:20:82:d6:bd ]; then
|
||||
hostname=cz-ap2
|
||||
channel_11a=108
|
||||
htmode_11a=VHT80
|
||||
elif [ "$mac" = 60:e3:27:ed:9b:b0 ]; then
|
||||
hostname=lz-ap0
|
||||
channel_11g=1
|
||||
fi
|
||||
|
||||
|
||||
# disable root password login
|
||||
sed -i 's/^root.*$/root:*:0:0:99999:7:::/' /etc/shadow
|
||||
|
||||
uci set system.@system[0].hostname=$hostname
|
||||
uci commit system
|
||||
echo $(uci get system.@system[0].hostname) > /proc/sys/kernel/hostname
|
||||
|
||||
uci set dropbear.@dropbear[0].PasswordAuth='off'
|
||||
uci set dropbear.@dropbear[0].RootPasswordAuth='off'
|
||||
uci commit dropbear
|
||||
/etc/init.d/dropbear restart
|
||||
|
||||
#WIFI_IFACES=$(uci show wireless | sed -nr 's/^wireless\.([^=]+)=wifi-iface*$/\1/p')
|
||||
WIFI_DEVICES=$(uci show wireless | sed -nr 's/^wireless\.([^=]+)=wifi-device*$/\1/p')
|
||||
|
||||
for radio in $WIFI_DEVICES; do
|
||||
disabled=1
|
||||
if [ $(uci get wireless.$radio.hwmode) = '11a' ]; then
|
||||
# 5 GHz
|
||||
if [ -n "$channel_11a" ]; then
|
||||
uci set wireless.$radio.channel=$channel_11a
|
||||
uci set wireless.$radio.htmode=${htmode_11a:-HT20}
|
||||
disabled=0
|
||||
fi
|
||||
elif [ $(uci get wireless.$radio.hwmode) = '11g' ]; then
|
||||
# 2.4 GHz
|
||||
if [ -n "$channel_11g" ]; then
|
||||
uci set wireless.$radio.channel=$channel_11g
|
||||
disabled=0
|
||||
fi
|
||||
fi
|
||||
|
||||
uci set wireless.$radio.disabled=$disabled
|
||||
uci set wireless.$radio.country=AT
|
||||
done
|
||||
uci commit wireless
|
@ -0,0 +1 @@
|
||||
../../../../../../.git/annex/objects/Vk/8w/SHA256E-s95--196dc6eecef78da77ea459b552dc3e0690f7c8e99007105d9715020ba7c60480/SHA256E-s95--196dc6eecef78da77ea459b552dc3e0690f7c8e99007105d9715020ba7c60480
|
@ -1,23 +0,0 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
mac=$(cat /sys/class/net/wlan0/address)
|
||||
|
||||
hostname=
|
||||
channel=
|
||||
if [ "$mac" = 60:e3:27:b8:16:ec ]; then
|
||||
hostname=cz-ap0
|
||||
channel=6
|
||||
elif [ "$mac" = 60:e3:27:ed:86:9a ]; then
|
||||
hostname=cz-ap1
|
||||
channel=11
|
||||
elif [ "$mac" = 60:e3:27:ed:9b:b0 ]; then
|
||||
hostname=lz-ap0
|
||||
channel=1
|
||||
fi
|
||||
|
||||
uci set system.@system[0].hostname=$hostname
|
||||
uci commit system
|
||||
uci set wireless.radio0.channel=$channel
|
||||
uci commit wireless
|
||||
echo $(uci get system.@system[0].hostname) > /proc/sys/kernel/hostname
|
@ -1 +0,0 @@
|
||||
../../../../../.git/annex/objects/Vk/8w/SHA256E-s95--196dc6eecef78da77ea459b552dc3e0690f7c8e99007105d9715020ba7c60480/SHA256E-s95--196dc6eecef78da77ea459b552dc3e0690f7c8e99007105d9715020ba7c60480
|
@ -0,0 +1,15 @@
|
||||
|
||||
config interface 'loopback'
|
||||
option ifname 'lo'
|
||||
option proto 'static'
|
||||
option ipaddr '127.0.0.1'
|
||||
option netmask '255.0.0.0'
|
||||
|
||||
config interface 'apctl'
|
||||
option ifname 'eth1.2'
|
||||
option proto 'dhcp'
|
||||
|
||||
config interface 'lan'
|
||||
option type 'bridge'
|
||||
option ifname 'eth0'
|
||||
option proto 'dhcp'
|
@ -0,0 +1,15 @@
|
||||
|
||||
config system
|
||||
option hostname 'ITS-AP-AC-LITE-unassigned'
|
||||
option timezone 'UTC'
|
||||
option ttylogin '0'
|
||||
option log_size '64'
|
||||
option urandom_seed '0'
|
||||
|
||||
config timeserver 'ntp'
|
||||
option enabled '1'
|
||||
option enable_server '0'
|
||||
list server '0.lede.pool.ntp.org'
|
||||
list server '1.lede.pool.ntp.org'
|
||||
list server '2.lede.pool.ntp.org'
|
||||
list server '3.lede.pool.ntp.org'
|
@ -0,0 +1,32 @@
|
||||
|
||||
config wifi-device 'radio0'
|
||||
option type 'mac80211'
|
||||
option hwmode '11a'
|
||||
option path 'pci0000:00/0000:00:00.0'
|
||||
option htmode 'VHT80'
|
||||
option disabled '1'
|
||||
option channel '108'
|
||||
option country 'AT'
|
||||
|
||||
config wifi-iface 'default_radio0'
|
||||
option device 'radio0'
|
||||
option network 'lan'
|
||||
option mode 'ap'
|
||||
option ssid 'it-syndikat 5 GHz'
|
||||
option encryption 'psk2'
|
||||
|
||||
config wifi-device 'radio1'
|
||||
option type 'mac80211'
|
||||
option channel '11'
|
||||
option hwmode '11g'
|
||||
option path 'platform/qca956x_wmac'
|
||||
option htmode 'HT20'
|
||||
option disabled '1'
|
||||
option country 'AT'
|
||||
|
||||
config wifi-iface 'default_radio1'
|
||||
option device 'radio1'
|
||||
option network 'lan'
|
||||
option mode 'ap'
|
||||
option ssid 'it-syndikat'
|
||||
option encryption 'psk2'
|
Loading…
Reference in New Issue