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.

59 lines
1.6 KiB
Bash

#!/bin/sh
. /lib/functions.sh
. /usr/lib/configsync_lib.sh
CS_SERVICE=cswireless
SERVICE=wireless
PSERVICE=${CS_PREFIX}${SERVICE}
my_logger() {
logger -t configsync_executor "${CS_SERVICE}" "${@}"
}
configsync_to_system()
{
# make working copy and get values from there step by step
uci_cs export $CS_SERVICE | uci_tmp import $CS_SERVICE
my_logger "This is ${0}/configsync_to_system()!"
# get common wifi parameter
VALUE="$( uci_tmp get ${CS_SERVICE}.wps.min_hold_time )"
uci_tmp set ${PSERVICE}.wps.min_hold_time="${VALUE}"
VALUE="$( uci_tmp get ${CS_SERVICE}.wps.max_hold_time )"
uci_tmp set ${PSERVICE}.wps.max_hold_time="${VALUE}"
VALUE="$( uci_tmp get ${CS_SERVICE}.qcawifi.atf_mode )"
uci_tmp set ${PSERVICE}.qcawifi.atf_mode="${VALUE}"
VALUE="$( uci_tmp get ${CS_SERVICE}.guest_wifi.auto_switch_off )"
uci_tmp set ${PSERVICE}.guest_wifi.auto_switch_off="${VALUE}"
VALUE="$( uci_tmp get ${CS_SERVICE}.guest_wifi.interval )"
uci_tmp set ${PSERVICE}.guest_wifi.interval="${VALUE}"
VALUE="$( uci_tmp get ${CS_SERVICE}.guest_wifi.starttime )"
uci_tmp set ${PSERVICE}.guest_wifi.starttime="${VALUE}"
add_to_list $CS_IMPORTSERVICELIST ${SERVICE}
}
dynamic_update()
{
my_logger "This is ${0}/dynamic_update()!"
}
init()
{
my_logger "This is ${0}/init()!"
}
if [ "${1}" = "init" ] || [ "${1}" = "configsync_to_system" ] || [ "${1}" = "dynamic_update" ]; then
"${@}"
else
my_logger "Unknown command ${1} in ${0}!"
fi