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.

97 lines
2.2 KiB
Bash

#!/bin/sh
. $MIGTEST/lib/migration/migration.sh
$LOG_TOOL "upgrade from v2.2.2 to v2.3.0"
. /lib/functions.sh
# Create a config for socketman
if [ ! -f /etc/config/socketman ]; then
touch /etc/config/socketman
$UCI_TOOL -q set socketman.service=service
$UCI_TOOL -q set socketman.service.disabled='1'
$UCI_TOOL commit socketman
fi
# Fix wrong auth option in wds bridge with radius auth (must be upper case)
fix_auth() {
local config="$1"
local mode auth
config_get mode "$config" mode
config_get auth "$config" auth
[ "$mode" = "sta" ] && [ -n "$auth" ] && $UCI_TOOL -q set wireless."$config".auth="$(echo "$auth" | tr a-z A-Z)"
}
# Fix broken configuration for WDS bridge (
fix_wds_bridge() {
local config="$1"
local mode device
config_get mode "$config" mode
config_get device "$config" device
[ "$mode" = "ap" ] && $UCI_TOOL -q set wireless."$config".wds="1"
[ "$device" = "radio0" ] && $UCI_TOOL -q delete wireless."$config".ieee80211w
}
config_load wireless
config_foreach fix_auth wifi-iface
config_foreach fix_wds_bridge wifi-iface
$UCI_TOOL commit wireless
# disable multicast_querier for all bridges (default enabled by netifd)
fix_bridge() {
local config="$1"
local type
config_get type "$config" type
[ "$type" = "bridge" ] && $UCI_TOOL -q set network."$config".multicast_querier=0
}
config_load network
config_foreach fix_bridge interface
$UCI_TOOL commit network
# increase default log buffer size and log to file
increase_log_size() {
local config="$1"
$UCI_TOOL -q set system."$config".log_buffer_size=512
$UCI_TOOL -q set system."$config".log_type=circular_file
$UCI_TOOL -q set system."$config".log_webui=/www/app/components/status/logs/log
}
config_load system
config_foreach increase_log_size system
$UCI_TOOL commit system
# led names for APs
led_sysfs() {
local config="$1"
local sysfs
local new
config_get sysfs "$config" sysfs
case "$sysfs" in
ew7479wac*)
new=dvl1200e
;;
ew7679wac*)
new=dvl1750e
;;
ew7479wic*)
new=dvl1200i
;;
ew7679wic*)
new=dvl1750i
;;
ew7679cap*)
new=dvl1750c
;;
ew7679oap*)
new=dvl1750x
;;
*)
return
;;
esac
$UCI_TOOL -q set system."$config".sysfs="$new:${sysfs#*:}"
}
config_load system
config_foreach led_sysfs led
$UCI_TOOL commit system
exit 0