mirror of
https://dev.iopsys.eu/bbf/icwmp.git
synced 2026-03-10 03:07:46 +01:00
update scripts and config
This commit is contained in:
parent
3f919a5b53
commit
62ff19fc0b
6 changed files with 191 additions and 256 deletions
|
|
@ -16,11 +16,56 @@ config 'cwmp' 'cpe'
|
|||
option 'userid' 'cpeinteno'
|
||||
option 'passwd' 'cpeinteno'
|
||||
option 'port' '7547'
|
||||
option ubus_socket /var/run/ubus.sock
|
||||
option 'ubus_socket' '/var/run/ubus.sock'
|
||||
|
||||
config 'cwmp' 'dm'
|
||||
list 'xml' '/etc/cwmpd/dm/tr098.xml'
|
||||
|
||||
config 'cwmp' 'notification'
|
||||
|
||||
config 'cwmp' 'accesslist'
|
||||
config scripts
|
||||
# load OpenWrt generic network functions
|
||||
list location /lib/functions/network.sh
|
||||
# load freecwmp common functions
|
||||
list location /usr/share/freecwmp/functions/common
|
||||
# freecwmp specific functions
|
||||
list location /usr/share/freecwmp/functions/device_info
|
||||
list get_value_function get_device_info
|
||||
list get_name_function get_device_info_name
|
||||
list get_notification_function get_device_info_notification
|
||||
list set_value_function set_device_info
|
||||
list set_notification_function set_device_info_notification
|
||||
list get_value_function get_device_info_generic
|
||||
list get_name_function get_device_info_generic_name
|
||||
list get_notification_function get_device_info_generic_notification
|
||||
list set_value_function set_device_info_generic
|
||||
list set_notification_function set_device_info_generic_notification
|
||||
list location /usr/share/freecwmp/functions/lan_device
|
||||
list get_value_function get_lan_device
|
||||
list get_name_function get_lan_device_name
|
||||
list get_notification_function get_lan_device_notification
|
||||
list set_value_function set_lan_device
|
||||
list set_notification_function set_lan_device_notification
|
||||
list location /usr/share/freecwmp/functions/management_server
|
||||
list get_value_function get_management_server
|
||||
list get_name_function get_management_server_name
|
||||
list get_notification_function get_management_server_notification
|
||||
list set_value_function set_management_server
|
||||
list set_notification_function set_management_server_notification
|
||||
list get_value_function get_management_server_generic
|
||||
list get_name_function get_management_server_generic_name
|
||||
list get_notification_function get_management_server_generic_notification
|
||||
list set_value_function set_management_server_generic
|
||||
list set_notification_function set_management_server_generic_notification
|
||||
list location /usr/share/freecwmp/functions/wan_device
|
||||
list get_value_function get_wan_device
|
||||
list get_name_function get_wan_device_name
|
||||
list get_notification_function get_wan_device_notification
|
||||
list set_value_function set_wan_device
|
||||
list set_notification_function set_wan_device_notification
|
||||
list location /usr/share/freecwmp/functions/misc
|
||||
list get_value_function get_misc
|
||||
list location /usr/share/freecwmp/functions/device_users
|
||||
list get_value_function get_device_users
|
||||
list set_value_function set_device_users
|
||||
list location /usr/share/freecwmp/functions/device_hosts
|
||||
list get_value_function get_device_hosts
|
||||
list location /usr/share/freecwmp/functions/device_routing
|
||||
list get_value_function get_device_routing
|
||||
list add_object_function add_lan_device
|
||||
list delete_object_function delete_lan_device
|
||||
|
|
|
|||
|
|
@ -115,6 +115,9 @@ case "$1" in
|
|||
__arg1="$3"
|
||||
fi
|
||||
;;
|
||||
inform)
|
||||
action="inform"
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -z "$action" ]; then
|
||||
|
|
@ -440,6 +443,21 @@ if [ "$action" = "delete_object" ]; then
|
|||
fi
|
||||
fi
|
||||
|
||||
if [ "$action" = "inform" ]; then
|
||||
action="get_value"
|
||||
|
||||
get_device_info_manufacturer
|
||||
get_device_info_oui
|
||||
get_device_info_product_class
|
||||
get_device_info_serial_number
|
||||
get_device_info_hardware_version
|
||||
get_device_info_software_version
|
||||
get_device_info_generic "InternetGatewayDevice.DeviceInfo.ProvisioningCode"
|
||||
get_wan_device_mng_interface_ip
|
||||
get_management_server_connection_request_url
|
||||
get_management_server_parameter_key
|
||||
fi
|
||||
|
||||
if [ ${FLAGS_debug} -eq ${FLAGS_TRUE} ]; then
|
||||
echo "[debug] exited at \"`date`\""
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -157,7 +157,7 @@ freecwmp_config_cwmp() {
|
|||
fi
|
||||
elif [ "set" = "$2" ]; then
|
||||
if [ "value" = "$3" ]; then
|
||||
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} set freecwmp.$1.value=$5 2> /dev/null
|
||||
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} set cwmp.$1.value=$5 2> /dev/null
|
||||
fi
|
||||
elif [ "check" = "$2" ]; then
|
||||
if [ "parameter" = "$3" ]; then
|
||||
|
|
@ -200,12 +200,12 @@ freecwmp_set_parameter_value() {
|
|||
local _val="$2"
|
||||
config_foreach freecwmp_config_cwmp "cwmp" "check" "parameter" "$_parm" "_section"
|
||||
if [ ! "$_section" = "" ]; then
|
||||
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} set freecwmp.$_section.value=$_val 2> /dev/null
|
||||
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} set cwmp.$_section.value=$_val 2> /dev/null
|
||||
else
|
||||
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} batch << EOF 2>&1 >/dev/null
|
||||
add freecwmp cwmp
|
||||
set freecwmp.@cwmp[-1].parameter="$_parm"
|
||||
set freecwmp.@cwmp[-1].value="$_val"
|
||||
set cwmp.@cwmp[-1].parameter="$_parm"
|
||||
set cwmp.@cwmp[-1].value="$_val"
|
||||
EOF
|
||||
fi
|
||||
config_foreach freecwmp_config_notifications "notifications" "get" "$_parm" "tmp"
|
||||
|
|
@ -236,17 +236,17 @@ freecwmp_get_parameter_notification() {
|
|||
freecwmp_set_parameter_notification() {
|
||||
local _parm="$1"
|
||||
local _val="$2"
|
||||
local tmp=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get freecwmp.@notifications[0] 2>/dev/null`
|
||||
local tmp=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get cwmp.@notifications[0] 2>/dev/null`
|
||||
if [ "$tmp" = "" ]; then
|
||||
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} add freecwmp notifications 2>&1 >/dev/null
|
||||
else
|
||||
uci_remove_list_element "freecwmp.@notifications[0].passive" "$_parm" 2>/dev/null
|
||||
uci_remove_list_element "freecwmp.@notifications[0].active" "$_parm" 2>/dev/null
|
||||
uci_remove_list_element "cwmp.@notifications[0].passive" "$_parm" 2>/dev/null
|
||||
uci_remove_list_element "cwmp.@notifications[0].active" "$_parm" 2>/dev/null
|
||||
fi
|
||||
if [ "$_val" -eq "1" ]; then
|
||||
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} add_list freecwmp.@notifications[0].passive="$_parm" 2>&1 >/dev/null
|
||||
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} add_list cwmp.@notifications[0].passive="$_parm" 2>&1 >/dev/null
|
||||
elif [ "$_val" -eq "2" ]; then
|
||||
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} add_list freecwmp.@notifications[0].active="$_parm" 2>&1 >/dev/null
|
||||
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} add_list cwmp.@notifications[0].active="$_parm" 2>&1 >/dev/null
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
@ -262,12 +262,12 @@ freecwmp_set_parameter_tag() {
|
|||
local _tag="$2"
|
||||
config_foreach freecwmp_config_cwmp "cwmp" "check" "parameter" "$_parm" "_section"
|
||||
if [ ! "$_section" = "" ]; then
|
||||
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} add_list freecwmp.$_section.tag=$_tag 2> /dev/null
|
||||
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} add_list cwmp.$_section.tag=$_tag 2> /dev/null
|
||||
else
|
||||
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} batch << EOF 2>&1 >/dev/null
|
||||
add freecwmp cwmp
|
||||
set freecwmp.@cwmp[-1].parameter="$_parm"
|
||||
add_list freecwmp.@cwmp[-1].tag="$_tag"
|
||||
set cwmp.@cwmp[-1].parameter="$_parm"
|
||||
add_list cwmp.@cwmp[-1].tag="$_tag"
|
||||
EOF
|
||||
fi
|
||||
}
|
||||
|
|
@ -318,8 +318,8 @@ freecwmp_set_parameter_fault() {
|
|||
local _fault="$2"
|
||||
/sbin/uci -P /var/state batch << EOF 2>&1 >/dev/null
|
||||
add freecwmp fault
|
||||
set freecwmp.@fault[-1].parameter="$_parm"
|
||||
set freecwmp.@fault[-1].fault_code="$_fault"
|
||||
set cwmp.@fault[-1].parameter="$_parm"
|
||||
set cwmp.@fault[-1].fault_code="$_fault"
|
||||
EOF
|
||||
}
|
||||
|
||||
|
|
@ -333,9 +333,9 @@ freecwmp_add_lan_device_ip_interface() {
|
|||
fi
|
||||
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} batch << EOF 2>&1 >/dev/null
|
||||
add freecwmp object
|
||||
set freecwmp.@object[-1].parameter="$_parm"
|
||||
set freecwmp.@object[-1].instance="$_instance"
|
||||
set freecwmp.@object[-1].interface="lan$indice"
|
||||
set cwmp.@object[-1].parameter="$_parm"
|
||||
set cwmp.@object[-1].instance="$_instance"
|
||||
set cwmp.@object[-1].interface="lan$indice"
|
||||
EOF
|
||||
let i=$indice-1
|
||||
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} set network.lan$indice=interface
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ get_device_info_manufacturer() {
|
|||
local val=""
|
||||
case "$action" in
|
||||
get_value)
|
||||
val=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get freecwmp.@device[0].manufacturer 2> /dev/null`
|
||||
val=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get cwmp.@device[0].manufacturer 2> /dev/null`
|
||||
;;
|
||||
get_name)
|
||||
val="0"
|
||||
|
|
@ -22,7 +22,7 @@ local val=$1
|
|||
local parm="InternetGatewayDevice.DeviceInfo.Manufacturer"
|
||||
case "$action" in
|
||||
set_value)
|
||||
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} set freecwmp.@device[0].manufacturer="$val"
|
||||
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} set cwmp.@device[0].manufacturer="$val"
|
||||
;;
|
||||
set_notification)
|
||||
freecwmp_set_parameter_notification "$parm" "$val"
|
||||
|
|
@ -34,7 +34,7 @@ get_device_info_oui() {
|
|||
local val=""
|
||||
case "$action" in
|
||||
get_value)
|
||||
val=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get freecwmp.@device[0].oui 2> /dev/null`
|
||||
val=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get cwmp.@device[0].oui 2> /dev/null`
|
||||
;;
|
||||
get_name)
|
||||
val="0"
|
||||
|
|
@ -51,7 +51,7 @@ local val=$1
|
|||
local parm="InternetGatewayDevice.DeviceInfo.ManufacturerOUI"
|
||||
case "$action" in
|
||||
set_value)
|
||||
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} set freecwmp.@device[0].oui="$val"
|
||||
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} set cwmp.@device[0].oui="$val"
|
||||
;;
|
||||
set_notification)
|
||||
freecwmp_set_parameter_notification "$parm" "$val"
|
||||
|
|
@ -63,7 +63,7 @@ get_device_info_product_class() {
|
|||
local val=""
|
||||
case "$action" in
|
||||
get_value)
|
||||
val=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get freecwmp.@device[0].product_class 2> /dev/null`
|
||||
val=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get cwmp.@device[0].product_class 2> /dev/null`
|
||||
;;
|
||||
get_name)
|
||||
val="0"
|
||||
|
|
@ -80,7 +80,7 @@ local val=$1
|
|||
local parm="InternetGatewayDevice.DeviceInfo.ProductClass"
|
||||
case "$action" in
|
||||
set_value)
|
||||
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} set freecwmp.@device[0].product_class="$val"
|
||||
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} set cwmp.@device[0].product_class="$val"
|
||||
;;
|
||||
set_notification)
|
||||
freecwmp_set_parameter_notification "$parm" "$val"
|
||||
|
|
@ -92,7 +92,7 @@ get_device_info_serial_number() {
|
|||
local val=""
|
||||
case "$action" in
|
||||
get_value)
|
||||
local val=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get freecwmp.@device[0].serial_number 2> /dev/null`
|
||||
local val=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get cwmp.@device[0].serial_number 2> /dev/null`
|
||||
;;
|
||||
get_name)
|
||||
local val="0"
|
||||
|
|
@ -109,7 +109,7 @@ local val=$1
|
|||
local parm="InternetGatewayDevice.DeviceInfo.SerialNumber"
|
||||
case "$action" in
|
||||
set_value)
|
||||
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} set freecwmp.@device[0].serial_number="$val"
|
||||
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} set cwmp.@device[0].serial_number="$val"
|
||||
;;
|
||||
set_notification)
|
||||
freecwmp_set_parameter_notification "$parm" "$val"
|
||||
|
|
@ -121,7 +121,7 @@ get_device_info_hardware_version() {
|
|||
local val=""
|
||||
case "$action" in
|
||||
get_value)
|
||||
val=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get freecwmp.@device[0].hardware_version 2> /dev/null`
|
||||
val=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get cwmp.@device[0].hardware_version 2> /dev/null`
|
||||
;;
|
||||
get_name)
|
||||
val="0"
|
||||
|
|
@ -138,7 +138,7 @@ local val=$1
|
|||
local parm="InternetGatewayDevice.DeviceInfo.HardwareVersion"
|
||||
case "$action" in
|
||||
set_value)
|
||||
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} set freecwmp.@device[0].hardware_version="$val"
|
||||
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} set cwmp.@device[0].hardware_version="$val"
|
||||
;;
|
||||
set_notification)
|
||||
freecwmp_set_parameter_notification "$parm" "$val"
|
||||
|
|
@ -150,7 +150,7 @@ get_device_info_software_version() {
|
|||
local val=""
|
||||
case "$action" in
|
||||
get_value)
|
||||
val=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get freecwmp.@device[0].software_version 2> /dev/null`
|
||||
val=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get cwmp.@device[0].software_version 2> /dev/null`
|
||||
;;
|
||||
get_name)
|
||||
val="0"
|
||||
|
|
@ -167,7 +167,7 @@ local val=$1
|
|||
local parm="InternetGatewayDevice.DeviceInfo.SoftwareVersion"
|
||||
case "$action" in
|
||||
set_value)
|
||||
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} set freecwmp.@device[0].software_version="$val"
|
||||
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} set cwmp.@device[0].software_version="$val"
|
||||
;;
|
||||
set_notification)
|
||||
freecwmp_set_parameter_notification "$parm" "$val"
|
||||
|
|
|
|||
|
|
@ -92,8 +92,8 @@ esac
|
|||
add_ip_interface() {
|
||||
local i=0
|
||||
local instance=0
|
||||
while [ "`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get freecwmp.@object[$i].instance 2>/dev/null`" != "" ] ;do
|
||||
instance=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get freecwmp.@object[$i].instance 2>/dev/null`
|
||||
while [ "`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get cwmp.@object[$i].instance 2>/dev/null`" != "" ] ;do
|
||||
instance=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get cwmp.@object[$i].instance 2>/dev/null`
|
||||
let i=$i+1
|
||||
done
|
||||
let instance=$instance+1
|
||||
|
|
@ -104,11 +104,11 @@ add_ip_interface() {
|
|||
|
||||
get_ip_interface() {
|
||||
local i=0
|
||||
while [ "`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get freecwmp.@object[$i].parameter 2>/dev/null`" != "" ]
|
||||
while [ "`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get cwmp.@object[$i].parameter 2>/dev/null`" != "" ]
|
||||
do
|
||||
if [ "$action" = "get_name" ];then
|
||||
let i=$i+1
|
||||
local parm=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get freecwmp.@object[$i].parameter 2>/dev/null`
|
||||
local parm=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get cwmp.@object[$i].parameter 2>/dev/null`
|
||||
val="1"
|
||||
ubus_freecwmp_output "$parm" "$val"
|
||||
fi
|
||||
|
|
@ -118,11 +118,11 @@ done
|
|||
get_ip_interface_ip_address() {
|
||||
local val=""
|
||||
local i=0
|
||||
while [ "`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get freecwmp.@object[$i].parameter 2>/dev/null`" != "" ]
|
||||
while [ "`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get cwmp.@object[$i].parameter 2>/dev/null`" != "" ]
|
||||
do
|
||||
let i=$i+1
|
||||
local parm=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get freecwmp.@object[$i].parameter 2>/dev/null`
|
||||
local indice=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get freecwmp.@object[$i].instance 2>/dev/null`
|
||||
local parm=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get cwmp.@object[$i].parameter 2>/dev/null`
|
||||
local indice=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get cwmp.@object[$i].instance 2>/dev/null`
|
||||
case "$action" in
|
||||
get_value)
|
||||
val=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get network.lan$indice.ipaddr 2> /dev/null`
|
||||
|
|
@ -142,14 +142,14 @@ set_ip_interface_ip_address() {
|
|||
local _parm="$1"
|
||||
local ipaddr="$2"
|
||||
_parm="${_parm%.*}."
|
||||
while [ \( "`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get freecwmp.@object[$i].parameter 2>/dev/null`" != "$_parm" \) -a \( "`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get freecwmp.@object[$i].parameter 2>/dev/null`" != "" \) ]
|
||||
while [ \( "`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get cwmp.@object[$i].parameter 2>/dev/null`" != "$_parm" \) -a \( "`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get cwmp.@object[$i].parameter 2>/dev/null`" != "" \) ]
|
||||
do
|
||||
let i=$i+1
|
||||
done
|
||||
if [ "`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get freecwmp.@object[$i].parameter 2>/dev/null`" = "" ]; then
|
||||
if [ "`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get cwmp.@object[$i].parameter 2>/dev/null`" = "" ]; then
|
||||
return $FAULT_CPE_INVALID_PARAMETER_NAME
|
||||
fi
|
||||
local indice=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get freecwmp.@object[$i].instance`
|
||||
local indice=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get cwmp.@object[$i].instance`
|
||||
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} set network.lan$indice.ipaddr=$ipaddr
|
||||
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} set network.lan$indice.proto=static
|
||||
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} commit
|
||||
|
|
@ -159,11 +159,11 @@ set_ip_interface_ip_address() {
|
|||
get_ip_interface_netmask() {
|
||||
local val=""
|
||||
local i=0
|
||||
while [ "`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get freecwmp.@object[$i].parameter 2>/dev/null`" != "" ]
|
||||
while [ "`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get cwmp.@object[$i].parameter 2>/dev/null`" != "" ]
|
||||
do
|
||||
let i=$i+1
|
||||
local parm=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get freecwmp.@object[$i].parameter 2>/dev/null`
|
||||
local indice=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get freecwmp.@object[$i].instance 2>/dev/null`
|
||||
local parm=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get cwmp.@object[$i].parameter 2>/dev/null`
|
||||
local indice=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get cwmp.@object[$i].instance 2>/dev/null`
|
||||
case "$action" in
|
||||
get_value)
|
||||
val=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get network.lan$indice.netmask 2> /dev/null`
|
||||
|
|
@ -183,22 +183,22 @@ set_ip_interface_netmask() {
|
|||
local _parm="$1"
|
||||
local netmask="$2"
|
||||
_parm="${_parm%.*}."
|
||||
while [ \( "`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get freecwmp.@object[$i].parameter 2>/dev/null`" != "$_parm" \) -a \( "`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get freecwmp.@object[$i].parameter 2>/dev/null`" != "" \) ]
|
||||
while [ \( "`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get cwmp.@object[$i].parameter 2>/dev/null`" != "$_parm" \) -a \( "`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get cwmp.@object[$i].parameter 2>/dev/null`" != "" \) ]
|
||||
do
|
||||
let i=$i+1
|
||||
done
|
||||
if [ "`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get freecwmp.@object[$i].parameter 2>/dev/null`" = "" ]; then
|
||||
if [ "`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get cwmp.@object[$i].parameter 2>/dev/null`" = "" ]; then
|
||||
return $FAULT_CPE_INVALID_PARAMETER_NAME
|
||||
fi
|
||||
local indice=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get freecwmp.@object[$i].instance`
|
||||
local indice=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get cwmp.@object[$i].instance`
|
||||
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} set network.lan$indice.netmask=$netmask
|
||||
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} commit
|
||||
return $FAULT_CPE_NO_FAULT
|
||||
}
|
||||
|
||||
delete_ip_interface() {
|
||||
local indice=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get freecwmp.@object[$1].instance`
|
||||
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} delete freecwmp.@object[$1]
|
||||
local indice=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get cwmp.@object[$1].instance`
|
||||
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} delete cwmp.@object[$1]
|
||||
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} delete network.lan$indice
|
||||
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} commit
|
||||
}
|
||||
|
|
@ -216,11 +216,11 @@ return $FAULT_CPE_INVALID_PARAMETER_NAME
|
|||
delete_lan_device() {
|
||||
local _parm="$1"
|
||||
local i=0
|
||||
while [ \( "`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get freecwmp.@object[$i].parameter 2>/dev/null`" != "$_parm" \) -a \( "`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get freecwmp.@object[$i].parameter 2>/dev/null`" != "" \) ]
|
||||
while [ \( "`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get cwmp.@object[$i].parameter 2>/dev/null`" != "$_parm" \) -a \( "`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get cwmp.@object[$i].parameter 2>/dev/null`" != "" \) ]
|
||||
do
|
||||
let i=$i+1
|
||||
done
|
||||
if [ "`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get freecwmp.@object[$i].parameter 2>/dev/null`" = "" ]; then
|
||||
if [ "`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get cwmp.@object[$i].parameter 2>/dev/null`" = "" ]; then
|
||||
return $FAULT_CPE_INVALID_PARAMETER_NAME
|
||||
fi
|
||||
case "${_parm%.*.}." in
|
||||
|
|
|
|||
|
|
@ -4,16 +4,12 @@
|
|||
get_management_server_url() {
|
||||
local tmp=${FLAGS_value}
|
||||
FLAGS_value=${FLAGS_TRUE}
|
||||
local scheme=`get_management_server_x_freecwmp_org__acs_scheme`
|
||||
local hostname=`get_management_server_x_freecwmp_org__acs_hostname`
|
||||
local port=`get_management_server_x_freecwmp_org__acs_port`
|
||||
local path=`get_management_server_x_freecwmp_org__acs_path`
|
||||
FLAGS_value=$tmp
|
||||
#local val=""
|
||||
local val=""
|
||||
local parm="InternetGatewayDevice.ManagementServer.URL"
|
||||
case "$action" in
|
||||
get_value)
|
||||
val=`echo $scheme://$hostname:$port$path`
|
||||
val=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get cwmp.acs.url`
|
||||
;;
|
||||
get_name)
|
||||
val="0"
|
||||
|
|
@ -30,32 +26,7 @@ local parm="InternetGatewayDevice.ManagementServer.URL"
|
|||
case "$action" in
|
||||
set_value)
|
||||
local url=$1
|
||||
local scheme
|
||||
local hostname
|
||||
local path
|
||||
local port
|
||||
|
||||
scheme=`echo $url | awk -F "://" '{ print $1 }'`
|
||||
hostname=`echo $url | awk -F "$scheme://" '{ print $2 }' | awk -F ":" '{ print $1 }' | awk -F "/" '{ print $1 }'`
|
||||
port=`echo $url | awk -F "$scheme://$hostname:" '{ print $2 }' | awk -F '/' '{ print $1 }'`
|
||||
|
||||
if [ -z "$port" ]; then
|
||||
port=80
|
||||
path=`echo $url | awk -F "$scheme://$hostname" '{ print $2 }'`
|
||||
echo 123 $path
|
||||
else
|
||||
path=`echo $url | awk -F "$scheme://$hostname:$port" '{ print $2 }'`
|
||||
fi
|
||||
|
||||
if [ -z "$path" ]; then
|
||||
path="/"
|
||||
fi
|
||||
|
||||
set_management_server_x_freecwmp_org__acs_scheme $scheme
|
||||
set_management_server_x_freecwmp_org__acs_hostname $hostname
|
||||
set_management_server_x_freecwmp_org__acs_port $port
|
||||
set_management_server_x_freecwmp_org__acs_path $path
|
||||
|
||||
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} set cwmp.acs.url="$val"
|
||||
ubus ${UBUS_SOCKET:+-s $UBUS_SOCKET} call tr069 inform '{ "event": "value_change" }' &
|
||||
;;
|
||||
set_notification)
|
||||
|
|
@ -70,7 +41,7 @@ local val=""
|
|||
local parm="InternetGatewayDevice.ManagementServer.Username"
|
||||
case "$action" in
|
||||
get_value)
|
||||
val=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get freecwmp.@acs[0].username 2> /dev/null`
|
||||
val=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get cwmp.acs.userid 2> /dev/null`
|
||||
;;
|
||||
get_name)
|
||||
val="0"
|
||||
|
|
@ -87,7 +58,7 @@ local val=$1
|
|||
local parm="InternetGatewayDevice.ManagementServer.Username"
|
||||
case "$action" in
|
||||
set_value)
|
||||
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} set freecwmp.@acs[0].username="$val"
|
||||
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} set cwmp.acs.userid="$val"
|
||||
;;
|
||||
set_notification)
|
||||
freecwmp_set_parameter_notification "$parm" "$val"
|
||||
|
|
@ -100,7 +71,7 @@ local val=""
|
|||
local parm="InternetGatewayDevice.ManagementServer.Password"
|
||||
case "$action" in
|
||||
get_value)
|
||||
val=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get freecwmp.@acs[0].password 2> /dev/null`
|
||||
val=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get cwmp.acs.passwd 2> /dev/null`
|
||||
;;
|
||||
get_name)
|
||||
val="0"
|
||||
|
|
@ -117,7 +88,7 @@ local val=$1
|
|||
local parm="InternetGatewayDevice.ManagementServer.Password"
|
||||
case "$action" in
|
||||
set_value)
|
||||
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} set freecwmp.@acs[0].password="$val"
|
||||
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} set cwmp.acs.passwd="$val"
|
||||
;;
|
||||
set_notification)
|
||||
freecwmp_set_parameter_notification "$parm" "$val"
|
||||
|
|
@ -125,12 +96,47 @@ case "$action" in
|
|||
esac
|
||||
}
|
||||
|
||||
get_management_server_parameter_key() {
|
||||
local tmp=${FLAGS_value}
|
||||
FLAGS_value=${FLAGS_TRUE}
|
||||
FLAGS_value=$tmp
|
||||
local val=""
|
||||
local parm="InternetGatewayDevice.ManagementServer.ParameterKey"
|
||||
case "$action" in
|
||||
get_value)
|
||||
val=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get cwmp.acs.ParameterKey`
|
||||
;;
|
||||
get_name)
|
||||
val="0"
|
||||
;;
|
||||
get_notification)
|
||||
freecwmp_get_parameter_notification "val" "$parm"
|
||||
;;
|
||||
esac
|
||||
ubus_freecwmp_output "$parm" "$val"
|
||||
}
|
||||
|
||||
set_management_server_parameter_key() {
|
||||
local parm="InternetGatewayDevice.ManagementServer.ParameterKey"
|
||||
case "$action" in
|
||||
set_value)
|
||||
local url=$1
|
||||
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} set cwmp.acs.ParameterKey="$val"
|
||||
ubus ${UBUS_SOCKET:+-s $UBUS_SOCKET} call tr069 inform '{ "event": "value_change" }' &
|
||||
;;
|
||||
set_notification)
|
||||
local val=$1
|
||||
freecwmp_set_parameter_notification "$parm" "$val"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
get_management_server_periodic_inform_enable() {
|
||||
local val=""
|
||||
local parm="InternetGatewayDevice.ManagementServer.PeriodicInformEnable"
|
||||
case "$action" in
|
||||
get_value)
|
||||
freecwmp_get_parameter_value "val" "$parm"
|
||||
val=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get cwmp.acs.periodic_inform_enable`
|
||||
;;
|
||||
get_name)
|
||||
val="1"
|
||||
|
|
@ -147,7 +153,7 @@ local val=$1
|
|||
local parm="InternetGatewayDevice.ManagementServer.PeriodicInformEnable"
|
||||
case "$action" in
|
||||
set_value)
|
||||
freecwmp_set_parameter_value "$parm" "$val"
|
||||
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} set cwmp.acs.periodic_inform_enable="$val"
|
||||
;;
|
||||
set_notification)
|
||||
freecwmp_set_parameter_notification "$parm" "$val"
|
||||
|
|
@ -160,7 +166,7 @@ local val=""
|
|||
local parm="InternetGatewayDevice.ManagementServer.PeriodicInformInterval"
|
||||
case "$action" in
|
||||
get_value)
|
||||
freecwmp_get_parameter_value "val" "$parm"
|
||||
val=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get cwmp.acs.periodic_inform_interval`
|
||||
;;
|
||||
get_name)
|
||||
val="1"
|
||||
|
|
@ -177,7 +183,7 @@ local val=$1
|
|||
local parm="InternetGatewayDevice.ManagementServer.PeriodicInformInterval"
|
||||
case "$action" in
|
||||
set_value)
|
||||
freecwmp_set_parameter_value "$parm" "$val"
|
||||
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get cwmp.acs.periodic_inform_interval="$val"
|
||||
;;
|
||||
set_notification)
|
||||
freecwmp_set_parameter_notification "$parm" "$val"
|
||||
|
|
@ -190,19 +196,7 @@ local val
|
|||
local parm="InternetGatewayDevice.ManagementServer.ConnectionRequestURL"
|
||||
case "$action" in
|
||||
get_value)
|
||||
if [ -z "$default_management_server_connection_request_url" ]; then
|
||||
local tmp=${FLAGS_value}
|
||||
FLAGS_value=${FLAGS_TRUE}
|
||||
local ip=`get_wan_device_mng_interface_ip`
|
||||
local port=`get_management_server_x_freecwmp_org__connection_request_port`
|
||||
FLAGS_value=$tmp
|
||||
|
||||
if [ -n "$ip" -a -n "$port" ]; then
|
||||
val="http://$ip:$port/"
|
||||
fi
|
||||
else
|
||||
val=$default_management_server_connection_request_url
|
||||
fi
|
||||
val=`uci get -q -P /etc/cwmpd/.iccu cwmp.cpe.iccu_url`
|
||||
;;
|
||||
get_name)
|
||||
val="0"
|
||||
|
|
@ -219,7 +213,7 @@ local val=""
|
|||
local parm="InternetGatewayDevice.ManagementServer.ConnectionRequestUsername"
|
||||
case "$action" in
|
||||
get_value)
|
||||
val=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get freecwmp.@local[0].username 2> /dev/null`
|
||||
val=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get cwmp.cpe.userid 2> /dev/null`
|
||||
;;
|
||||
get_name)
|
||||
val="0"
|
||||
|
|
@ -236,7 +230,7 @@ local val=$1
|
|||
local parm="InternetGatewayDevice.ManagementServer.ConnectionRequestUsername"
|
||||
case "$action" in
|
||||
set_value)
|
||||
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} set freecwmp.@local[0].username="$val"
|
||||
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} set cwmp.cpe.userid="$val"
|
||||
;;
|
||||
set_notification)
|
||||
freecwmp_set_parameter_notification "$parm" "$val"
|
||||
|
|
@ -249,7 +243,7 @@ local val=""
|
|||
local parm="InternetGatewayDevice.ManagementServer.ConnectionRequestPassword"
|
||||
case "$action" in
|
||||
get_value)
|
||||
val=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get freecwmp.@local[0].password 2> /dev/null`
|
||||
val=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get cwmp.cpe.passwd 2> /dev/null`
|
||||
;;
|
||||
get_name)
|
||||
val="0"
|
||||
|
|
@ -266,7 +260,7 @@ local val=$1
|
|||
local parm="InternetGatewayDevice.ManagementServer.ConnectionRequestPassword"
|
||||
case "$action" in
|
||||
set_value)
|
||||
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} set freecwmp.@local[0].password="$val"
|
||||
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} set cwmp.cpe.passwd="$val"
|
||||
;;
|
||||
set_notification)
|
||||
freecwmp_set_parameter_notification "$parm" "$val"
|
||||
|
|
@ -281,7 +275,7 @@ local val=""
|
|||
local parm="InternetGatewayDevice.ManagementServer.X_freecwmp_org__ACS_Scheme"
|
||||
case "$action" in
|
||||
get_value)
|
||||
val=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get freecwmp.@acs[0].scheme 2> /dev/null`
|
||||
val=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get cwmp.@acs[0].scheme 2> /dev/null`
|
||||
;;
|
||||
get_name)
|
||||
val="1"
|
||||
|
|
@ -302,7 +296,7 @@ local val=$1
|
|||
local parm="InternetGatewayDevice.ManagementServer.X_freecwmp_org__ACS_Scheme"
|
||||
case "$action" in
|
||||
set_value)
|
||||
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} set freecwmp.@acs[0].scheme="$val"
|
||||
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} set cwmp.@acs[0].scheme="$val"
|
||||
;;
|
||||
set_notification)
|
||||
freecwmp_set_parameter_notification "$parm" "$val"
|
||||
|
|
@ -315,7 +309,7 @@ local val=""
|
|||
local parm="InternetGatewayDevice.ManagementServer.X_freecwmp_org__ACS_Hostname"
|
||||
case "$action" in
|
||||
get_value)
|
||||
val=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get freecwmp.@acs[0].hostname 2> /dev/null`
|
||||
val=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get cwmp.@acs[0].hostname 2> /dev/null`
|
||||
;;
|
||||
get_name)
|
||||
val="1"
|
||||
|
|
@ -337,9 +331,9 @@ local parm="InternetGatewayDevice.ManagementServer.X_freecwmp_org__ACS_Hostname"
|
|||
case "$action" in
|
||||
set_value)
|
||||
if [ -z "$default_management_server_acs_hostname" ]; then
|
||||
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} set freecwmp.@acs[0].hostname="$val"
|
||||
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} set cwmp.@acs[0].hostname="$val"
|
||||
else
|
||||
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} set freecwmp.@acs[0].hostname="$default_management_server_acs_hostname"
|
||||
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} set cwmp.@acs[0].hostname="$default_management_server_acs_hostname"
|
||||
fi
|
||||
;;
|
||||
set_notification)
|
||||
|
|
@ -353,7 +347,7 @@ local val=""
|
|||
local parm="InternetGatewayDevice.ManagementServer.X_freecwmp_org__ACS_Port"
|
||||
case "$action" in
|
||||
get_value)
|
||||
val=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get freecwmp.@acs[0].port 2> /dev/null`
|
||||
val=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get cwmp.@acs[0].port 2> /dev/null`
|
||||
;;
|
||||
get_name)
|
||||
val="1"
|
||||
|
|
@ -374,7 +368,7 @@ local val=$1
|
|||
local parm="InternetGatewayDevice.ManagementServer.X_freecwmp_org__ACS_Port"
|
||||
case "$action" in
|
||||
set_value)
|
||||
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} set freecwmp.@acs[0].port="$val"
|
||||
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} set cwmp.@acs[0].port="$val"
|
||||
;;
|
||||
set_notification)
|
||||
freecwmp_set_parameter_notification "$parm" "$val"
|
||||
|
|
@ -387,7 +381,7 @@ local val=""
|
|||
local parm="InternetGatewayDevice.ManagementServer.X_freecwmp_org__ACS_Path"
|
||||
case "$action" in
|
||||
get_value)
|
||||
val=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get freecwmp.@acs[0].path 2> /dev/null`
|
||||
val=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get cwmp.@acs[0].path 2> /dev/null`
|
||||
;;
|
||||
get_name)
|
||||
val="1"
|
||||
|
|
@ -408,7 +402,7 @@ local val=$1
|
|||
local parm="InternetGatewayDevice.ManagementServer.X_freecwmp_org__ACS_Path"
|
||||
case "$action" in
|
||||
set_value)
|
||||
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} set freecwmp.@acs[0].path="$val"
|
||||
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} set cwmp.@acs[0].path="$val"
|
||||
;;
|
||||
set_notification)
|
||||
freecwmp_set_parameter_notification "$parm" "$val"
|
||||
|
|
@ -421,7 +415,7 @@ local val=""
|
|||
local parm="InternetGatewayDevice.ManagementServer.X_freecwmp_org__Connection_Request_Port"
|
||||
case "$action" in
|
||||
get_value)
|
||||
val=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get freecwmp.@local[0].port 2> /dev/null`
|
||||
val=`/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} get cwmp.@local[0].port 2> /dev/null`
|
||||
;;
|
||||
get_name)
|
||||
val="1"
|
||||
|
|
@ -442,7 +436,7 @@ local val=$1
|
|||
local parm="InternetGatewayDevice.ManagementServer.X_freecwmp_org__Connection_Request_Port"
|
||||
case "$action" in
|
||||
set_value)
|
||||
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} set freecwmp.@local[0].port="$val"
|
||||
/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} set cwmp.@local[0].port="$val"
|
||||
;;
|
||||
set_notification)
|
||||
freecwmp_set_parameter_notification "$parm" "$val"
|
||||
|
|
@ -461,11 +455,6 @@ case "$1" in
|
|||
get_management_server_connection_request_url
|
||||
get_management_server_connection_request_username
|
||||
get_management_server_connection_request_password
|
||||
get_management_server_x_freecwmp_org__acs_scheme
|
||||
get_management_server_x_freecwmp_org__acs_hostname
|
||||
get_management_server_x_freecwmp_org__acs_port
|
||||
get_management_server_x_freecwmp_org__acs_path
|
||||
get_management_server_x_freecwmp_org__connection_request_port
|
||||
return $FAULT_CPE_NO_FAULT
|
||||
;;
|
||||
InternetGatewayDevice.ManagementServer.)
|
||||
|
|
@ -477,11 +466,6 @@ case "$1" in
|
|||
get_management_server_connection_request_url
|
||||
get_management_server_connection_request_username
|
||||
get_management_server_connection_request_password
|
||||
get_management_server_x_freecwmp_org__acs_scheme
|
||||
get_management_server_x_freecwmp_org__acs_hostname
|
||||
get_management_server_x_freecwmp_org__acs_port
|
||||
get_management_server_x_freecwmp_org__acs_path
|
||||
get_management_server_x_freecwmp_org__connection_request_port
|
||||
return $FAULT_CPE_NO_FAULT
|
||||
;;
|
||||
InternetGatewayDevice.ManagementServer.URL)
|
||||
|
|
@ -516,24 +500,8 @@ case "$1" in
|
|||
get_management_server_connection_request_password
|
||||
return $FAULT_CPE_NO_FAULT
|
||||
;;
|
||||
InternetGatewayDevice.ManagementServer.X_freecwmp_org__ACS_Scheme)
|
||||
get_management_server_x_freecwmp_org__acs_scheme
|
||||
return $FAULT_CPE_NO_FAULT
|
||||
;;
|
||||
InternetGatewayDevice.ManagementServer.X_freecwmp_org__ACS_Hostname)
|
||||
get_management_server_x_freecwmp_org__acs_hostname
|
||||
return $FAULT_CPE_NO_FAULT
|
||||
;;
|
||||
InternetGatewayDevice.ManagementServer.X_freecwmp_org__ACS_Port)
|
||||
get_management_server_x_freecwmp_org__acs_port
|
||||
return $FAULT_CPE_NO_FAULT
|
||||
;;
|
||||
InternetGatewayDevice.ManagementServer.X_freecwmp_org__ACS_Path)
|
||||
get_management_server_x_freecwmp_org__acs_path
|
||||
return $FAULT_CPE_NO_FAULT
|
||||
;;
|
||||
InternetGatewayDevice.ManagementServer.X_freecwmp_org__Connection_Request_Port)
|
||||
get_management_server_x_freecwmp_org__connection_request_port
|
||||
InternetGatewayDevice.ManagementServer.ParameterKey)
|
||||
get_management_server_parameter_key
|
||||
return $FAULT_CPE_NO_FAULT
|
||||
;;
|
||||
esac
|
||||
|
|
@ -553,11 +521,6 @@ case "$1" in
|
|||
get_management_server_connection_request_url
|
||||
get_management_server_connection_request_username
|
||||
get_management_server_connection_request_password
|
||||
get_management_server_x_freecwmp_org__acs_scheme
|
||||
get_management_server_x_freecwmp_org__acs_hostname
|
||||
get_management_server_x_freecwmp_org__acs_port
|
||||
get_management_server_x_freecwmp_org__acs_path
|
||||
get_management_server_x_freecwmp_org__connection_request_port
|
||||
fi
|
||||
return $FAULT_CPE_NO_FAULT
|
||||
;;
|
||||
|
|
@ -571,11 +534,6 @@ case "$1" in
|
|||
get_management_server_connection_request_url
|
||||
get_management_server_connection_request_username
|
||||
get_management_server_connection_request_password
|
||||
get_management_server_x_freecwmp_org__acs_scheme
|
||||
get_management_server_x_freecwmp_org__acs_hostname
|
||||
get_management_server_x_freecwmp_org__acs_port
|
||||
get_management_server_x_freecwmp_org__acs_path
|
||||
get_management_server_x_freecwmp_org__connection_request_port
|
||||
return $FAULT_CPE_NO_FAULT
|
||||
;;
|
||||
InternetGatewayDevice.ManagementServer.URL)
|
||||
|
|
@ -634,39 +592,11 @@ case "$1" in
|
|||
get_management_server_connection_request_password
|
||||
return $FAULT_CPE_NO_FAULT
|
||||
;;
|
||||
InternetGatewayDevice.ManagementServer.X_freecwmp_org__ACS_Scheme)
|
||||
InternetGatewayDevice.ManagementServer.ParameterKey)
|
||||
if [ "$2" = "1" ]; then
|
||||
return $FAULT_CPE_INVALID_ARGUMENTS
|
||||
fi
|
||||
get_management_server_x_freecwmp_org__acs_scheme
|
||||
return $FAULT_CPE_NO_FAULT
|
||||
;;
|
||||
InternetGatewayDevice.ManagementServer.X_freecwmp_org__ACS_Hostname)
|
||||
if [ "$2" = "1" ]; then
|
||||
return $FAULT_CPE_INVALID_ARGUMENTS
|
||||
fi
|
||||
get_management_server_x_freecwmp_org__acs_hostname
|
||||
return $FAULT_CPE_NO_FAULT
|
||||
;;
|
||||
InternetGatewayDevice.ManagementServer.X_freecwmp_org__ACS_Port)
|
||||
if [ "$2" = "1" ]; then
|
||||
return $FAULT_CPE_INVALID_ARGUMENTS
|
||||
fi
|
||||
get_management_server_x_freecwmp_org__acs_port
|
||||
return $FAULT_CPE_NO_FAULT
|
||||
;;
|
||||
InternetGatewayDevice.ManagementServer.X_freecwmp_org__ACS_Path)
|
||||
if [ "$2" = "1" ]; then
|
||||
return $FAULT_CPE_INVALID_ARGUMENTS
|
||||
fi
|
||||
get_management_server_x_freecwmp_org__acs_path
|
||||
return $FAULT_CPE_NO_FAULT
|
||||
;;
|
||||
InternetGatewayDevice.ManagementServer.X_freecwmp_org__Connection_Request_Port)
|
||||
if [ "$2" = "1" ]; then
|
||||
return $FAULT_CPE_INVALID_ARGUMENTS
|
||||
fi
|
||||
get_management_server_x_freecwmp_org__connection_request_port
|
||||
get_management_server_parameter_key
|
||||
return $FAULT_CPE_NO_FAULT
|
||||
;;
|
||||
esac
|
||||
|
|
@ -684,11 +614,6 @@ case "$1" in
|
|||
get_management_server_connection_request_url
|
||||
get_management_server_connection_request_username
|
||||
get_management_server_connection_request_password
|
||||
get_management_server_x_freecwmp_org__acs_scheme
|
||||
get_management_server_x_freecwmp_org__acs_hostname
|
||||
get_management_server_x_freecwmp_org__acs_port
|
||||
get_management_server_x_freecwmp_org__acs_path
|
||||
get_management_server_x_freecwmp_org__connection_request_port
|
||||
return $FAULT_CPE_NO_FAULT
|
||||
;;
|
||||
InternetGatewayDevice.ManagementServer.)
|
||||
|
|
@ -700,11 +625,6 @@ case "$1" in
|
|||
get_management_server_connection_request_url
|
||||
get_management_server_connection_request_username
|
||||
get_management_server_connection_request_password
|
||||
get_management_server_x_freecwmp_org__acs_scheme
|
||||
get_management_server_x_freecwmp_org__acs_hostname
|
||||
get_management_server_x_freecwmp_org__acs_port
|
||||
get_management_server_x_freecwmp_org__acs_path
|
||||
get_management_server_x_freecwmp_org__connection_request_port
|
||||
return $FAULT_CPE_NO_FAULT
|
||||
;;
|
||||
InternetGatewayDevice.ManagementServer.URL)
|
||||
|
|
@ -739,24 +659,8 @@ case "$1" in
|
|||
get_management_server_connection_request_password
|
||||
return $FAULT_CPE_NO_FAULT
|
||||
;;
|
||||
InternetGatewayDevice.ManagementServer.X_freecwmp_org__ACS_Scheme)
|
||||
get_management_server_x_freecwmp_org__acs_scheme
|
||||
return $FAULT_CPE_NO_FAULT
|
||||
;;
|
||||
InternetGatewayDevice.ManagementServer.X_freecwmp_org__ACS_Hostname)
|
||||
get_management_server_x_freecwmp_org__acs_hostname
|
||||
return $FAULT_CPE_NO_FAULT
|
||||
;;
|
||||
InternetGatewayDevice.ManagementServer.X_freecwmp_org__ACS_Port)
|
||||
get_management_server_x_freecwmp_org__acs_port
|
||||
return $FAULT_CPE_NO_FAULT
|
||||
;;
|
||||
InternetGatewayDevice.ManagementServer.X_freecwmp_org__ACS_Path)
|
||||
get_management_server_x_freecwmp_org__acs_path
|
||||
return $FAULT_CPE_NO_FAULT
|
||||
;;
|
||||
InternetGatewayDevice.ManagementServer.X_freecwmp_org__Connection_Request_Port)
|
||||
get_management_server_x_freecwmp_org__connection_request_port
|
||||
InternetGatewayDevice.ManagementServer.ParameterKey)
|
||||
get_management_server_parameter_key
|
||||
return $FAULT_CPE_NO_FAULT
|
||||
;;
|
||||
esac
|
||||
|
|
@ -797,24 +701,8 @@ case "$1" in
|
|||
set_management_server_connection_request_password "$2"
|
||||
return $FAULT_CPE_NO_FAULT
|
||||
;;
|
||||
InternetGatewayDevice.ManagementServer.X_freecwmp_org__ACS_Scheme)
|
||||
set_management_server_x_freecwmp_org__acs_scheme "$2"
|
||||
return $FAULT_CPE_NO_FAULT
|
||||
;;
|
||||
InternetGatewayDevice.ManagementServer.X_freecwmp_org__ACS_Hostname)
|
||||
set_management_server_x_freecwmp_org__acs_hostname "$2"
|
||||
return $FAULT_CPE_NO_FAULT
|
||||
;;
|
||||
InternetGatewayDevice.ManagementServer.X_freecwmp_org__ACS_Port)
|
||||
set_management_server_x_freecwmp_org__acs_port "$2"
|
||||
return $FAULT_CPE_NO_FAULT
|
||||
;;
|
||||
InternetGatewayDevice.ManagementServer.X_freecwmp_org__ACS_Path)
|
||||
set_management_server_x_freecwmp_org__acs_path "$2"
|
||||
return $FAULT_CPE_NO_FAULT
|
||||
;;
|
||||
InternetGatewayDevice.ManagementServer.X_freecwmp_org__Connection_Request_Port)
|
||||
set_management_server_x_freecwmp_org__connection_request_port "$2"
|
||||
InternetGatewayDevice.ManagementServer.ParameterKey)
|
||||
set_management_server_parameter_key "$2"
|
||||
return $FAULT_CPE_NO_FAULT
|
||||
;;
|
||||
esac
|
||||
|
|
@ -856,24 +744,8 @@ case "$1" in
|
|||
set_management_server_connection_request_password "$2"
|
||||
return $FAULT_CPE_NO_FAULT
|
||||
;;
|
||||
InternetGatewayDevice.ManagementServer.X_freecwmp_org__ACS_Scheme)
|
||||
set_management_server_x_freecwmp_org__acs_scheme "$2"
|
||||
return $FAULT_CPE_NO_FAULT
|
||||
;;
|
||||
InternetGatewayDevice.ManagementServer.X_freecwmp_org__ACS_Hostname)
|
||||
set_management_server_x_freecwmp_org__acs_hostname "$2"
|
||||
return $FAULT_CPE_NO_FAULT
|
||||
;;
|
||||
InternetGatewayDevice.ManagementServer.X_freecwmp_org__ACS_Port)
|
||||
set_management_server_x_freecwmp_org__acs_port "$2"
|
||||
return $FAULT_CPE_NO_FAULT
|
||||
;;
|
||||
InternetGatewayDevice.ManagementServer.X_freecwmp_org__ACS_Path)
|
||||
set_management_server_x_freecwmp_org__acs_path "$2"
|
||||
return $FAULT_CPE_NO_FAULT
|
||||
;;
|
||||
InternetGatewayDevice.ManagementServer.X_freecwmp_org__Connection_Request_Port)
|
||||
set_management_server_x_freecwmp_org__connection_request_port "$2"
|
||||
InternetGatewayDevice.ManagementServer.ParameterKey)
|
||||
set_management_server_parameter_key "$2"
|
||||
return $FAULT_CPE_NO_FAULT
|
||||
;;
|
||||
esac
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue