From 12ab98ec3a258e09034b0cf13f36c6ebec54bcb0 Mon Sep 17 00:00:00 2001 From: zribiahmed Date: Sun, 25 Nov 2012 13:42:44 +0000 Subject: [PATCH] --- src/scripts/freecwmp.sh | 10 +++++----- src/scripts/functions/common | 6 ++++++ src/scripts/functions/device_info | 4 ++++ src/scripts/functions/lan_device | 7 +++++++ src/scripts/functions/management_server | 4 ++++ src/scripts/functions/wan_device | 17 +++++++++-------- 6 files changed, 35 insertions(+), 13 deletions(-) diff --git a/src/scripts/freecwmp.sh b/src/scripts/freecwmp.sh index 134792b..87e9263 100644 --- a/src/scripts/freecwmp.sh +++ b/src/scripts/freecwmp.sh @@ -42,7 +42,7 @@ case "$1" in if [ "$2" = "notification" ]; then __arg1="$3" __arg2="$4" - __arg3="echo $5| tr '[A-Z]' '[a-z]'" + __arg3="`echo $5| tr '[A-Z]' '[a-z]'`" action="set_notification" elif [ "$2" = "tag" ]; then __arg1="$3" @@ -299,15 +299,15 @@ if [ "$action" = "get_notification" -o "$action" = "get_all" ]; then fi if [ "$action" = "set_notification" ]; then - no_fault="0" - freecwmp_check_fault "$__arg1" - fault_code="$?" if [ "$__arg3" = "true" ]; then __arg3="1" elif [ "$__arg3" = "false" ]; then __arg3="0" fi if [ "$__arg3" = "1" ]; then + no_fault="0" + freecwmp_check_fault "$__arg1" + fault_code="$?" if [ "$fault_code" = "0" ]; then if [ \( "$__arg1" = "InternetGatewayDevice." \) -o \( "$__arg1" = "" \) ]; then __arg1="InternetGatewayDevice." @@ -394,7 +394,7 @@ if [ \( "$action" = "apply_notification" \) -o \( "$action" = "apply_value" \) ] if [ "$action" = "apply_notification" ]; then break; fi done rm -rf /var/state/cwmp 2> /dev/null - /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} revert freecwmp + /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} revert cwmp fi fi diff --git a/src/scripts/functions/common b/src/scripts/functions/common index 58b78f8..a71e5f4 100644 --- a/src/scripts/functions/common +++ b/src/scripts/functions/common @@ -176,6 +176,9 @@ freecwmp_config_notifications() { if [ "$item" = "$3" ]; then eval "export -- \"$4=2\"" return 0 + elif [ "`echo $3|grep $item`" = "$3" ]; then + eval "export -- \"$4=2\"" + return 0 fi done for item in $__passive @@ -183,6 +186,9 @@ freecwmp_config_notifications() { if [ "$item" = "$3" ]; then eval "export -- \"$4=1\"" return 0 + elif [ "`echo $3|grep $item`" = "$3" ]; then + eval "export -- \"$4=1\"" + return 0 fi done } diff --git a/src/scripts/functions/device_info b/src/scripts/functions/device_info index 96bfd54..2fd8ed9 100644 --- a/src/scripts/functions/device_info +++ b/src/scripts/functions/device_info @@ -452,6 +452,10 @@ return $FAULT_CPE_INVALID_PARAMETER_NAME set_device_info_notification() { case "$1" in + InternetGatewayDevice.DeviceInfo.) + freecwmp_set_parameter_notification "$1" "$2" + return $FAULT_CPE_NO_FAULT + ;; InternetGatewayDevice.DeviceInfo.Manufacturer) set_device_info_manufacturer "$2" return $FAULT_CPE_NO_FAULT diff --git a/src/scripts/functions/lan_device b/src/scripts/functions/lan_device index 2781fff..bae16da 100644 --- a/src/scripts/functions/lan_device +++ b/src/scripts/functions/lan_device @@ -427,6 +427,13 @@ return $FAULT_CPE_INVALID_PARAMETER_NAME set_lan_device_notification() { case "$1" in + InternetGatewayDevice.LANDevice.|\ + InternetGatewayDevice.LANDevice.1.|\ + InternetGatewayDevice.LANDevice.1.WLANConfiguration.|\ + InternetGatewayDevice.LANDevice.1.WLANConfiguration.1.) + freecwmp_set_parameter_notification "$1" "$2" + return $FAULT_CPE_NO_FAULT + ;; InternetGatewayDevice.LANDevice.1.WLANConfiguration.1.Enable) set_wlan_enable 0 "$2" return $FAULT_CPE_NO_FAULT diff --git a/src/scripts/functions/management_server b/src/scripts/functions/management_server index d28f0dd..f929241 100644 --- a/src/scripts/functions/management_server +++ b/src/scripts/functions/management_server @@ -712,6 +712,10 @@ return $FAULT_CPE_INVALID_PARAMETER_NAME set_management_server_notification() { case "$1" in + InternetGatewayDevice.ManagementServer.) + freecwmp_set_parameter_notification "$1" "$2" + return $FAULT_CPE_NO_FAULT + ;; InternetGatewayDevice.ManagementServer.URL) set_management_server_url "$2" return $FAULT_CPE_NO_FAULT diff --git a/src/scripts/functions/wan_device b/src/scripts/functions/wan_device index d44a891..976fdeb 100644 --- a/src/scripts/functions/wan_device +++ b/src/scripts/functions/wan_device @@ -475,14 +475,6 @@ return $FAULT_CPE_INVALID_PARAMETER_NAME set_wan_device() { case "$1" in - InternetGatewayDevice.WANDevice.|\ - InternetGatewayDevice.WANDevice.1.|\ - InternetGatewayDevice.WANDevice.1.WANConnectionDevice.|\ - InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.|\ - InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.|\ - InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.1.) - freecwmp_set_parameter_notification "$1" "$2" - ;; InternetGatewayDevice.WANDevice.1.WANConnectionDevice.2.WANPPPConnection.1.Enable) set_wan_device_wan_ppp_enable "$2" return $FAULT_CPE_NO_FAULT @@ -502,6 +494,15 @@ return $FAULT_CPE_INVALID_PARAMETER_NAME set_wan_device_notification() { case "$1" in + InternetGatewayDevice.WANDevice.|\ + InternetGatewayDevice.WANDevice.1.|\ + InternetGatewayDevice.WANDevice.1.WANConnectionDevice.|\ + InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.|\ + InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.|\ + InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.1.) + freecwmp_set_parameter_notification "$1" "$2" + return $FAULT_CPE_NO_FAULT + ;; InternetGatewayDevice.WANDevice.1.WANConnectionDevice.2.WANPPPConnection.1.Enable) set_wan_device_wan_ppp_enable "$2" return $FAULT_CPE_NO_FAULT