You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
61 lines
1.3 KiB
Bash
61 lines
1.3 KiB
Bash
#!/bin/sh
|
|
#
|
|
# Copyright (C) 2015-2016 devolo AG
|
|
#
|
|
|
|
[ -f /etc/customization.sh ] && . /etc/customization.sh
|
|
|
|
# if basic configuration was already applied, exit
|
|
[ "$(uci -q get delos.uci_defaults.wireless)" = "" ] || exit 0
|
|
|
|
if [ -f /lib/ar71xx.sh ]; then
|
|
PLATFORM=ar71xx
|
|
. /lib/ar71xx.sh
|
|
elif [ -f /lib/ipq806x.sh ]; then
|
|
PLATFORM=ipq806x
|
|
. /lib/ipq806x.sh
|
|
fi
|
|
|
|
. /lib/functions.sh
|
|
. /lib/delos-functions.sh
|
|
|
|
board=$(${PLATFORM}_board_name)
|
|
|
|
handle_wifi_device() {
|
|
# set country
|
|
uci_set wireless "$1" country "$2"
|
|
}
|
|
|
|
handle_wifi_iface() {
|
|
# set default SSID
|
|
uci_set wireless "$1" ssid "$2"
|
|
# set default WPA key (Security ID w/o '-')
|
|
uci_set wireless "$1" key "$3"
|
|
}
|
|
|
|
get_baptization() {
|
|
COUNTRY=$(uci_get_state delos baptization WiFiCountryCode)
|
|
DPWD=$(uci_get_state delos-private baptization DlanSecurityID)
|
|
SSID=$(dvl_make_default_ssid main)
|
|
}
|
|
|
|
set_wireless_config() {
|
|
get_baptization
|
|
config_load wireless
|
|
config_foreach handle_wifi_device wifi-device "${COUNTRY:-DE}"
|
|
if [ -n "$SSID" -a -n "$DPWD" ]; then
|
|
config_foreach handle_wifi_iface wifi-iface "$SSID" "${DPWD//-}"
|
|
else
|
|
logger "delos (wireless): No baptization available"
|
|
fi
|
|
uci_commit wireless
|
|
|
|
# set basic config done flag
|
|
uci set delos.uci_defaults.wireless=1
|
|
uci commit delos
|
|
}
|
|
|
|
set_wireless_config
|
|
|
|
exit 0
|