freecwmp
[Top] [All Lists]

[PATCH 07/27] Update device_users script to support communicte data of

To: freecwmp@linux-mips.org
Subject: [PATCH 07/27] Update device_users script to support communicte data of get parameter values to the core via ubus Contributed by Inteno Broadband Technology AB
From: Mohamed <mohamed.kallel@pivasoftware.com>
Date: Thu, 6 Dec 2012 16:54:32 +0100
Cc: freecwmp@lukaperkov.net, Mohamed <mohamed.kallel@pivasoftware.com>, Ahmed ZRIBI <ahmed.zribi@pivasoftware.com>
In-reply-to: <1354809292-2467-1-git-send-email-mohamed.kallel@pivasoftware.com>
Original-recipient: rfc822;freecwmp@linux-mips.org
References: <mohamed.kallel@pivasoftware.com> <1354809292-2467-1-git-send-email-mohamed.kallel@pivasoftware.com>
Sender: freecwmp-bounce@linux-mips.org
Signed-off-by: Ahmed ZRIBI <ahmed.zribi@pivasoftware.com>
Signed-off-by: Mohamed <mohamed.kallel@pivasoftware.com>
---
 ext/openwrt/scripts/functions/device_users |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/ext/openwrt/scripts/functions/device_users 
b/ext/openwrt/scripts/functions/device_users
index 0d377f7..d8dba61 100644
--- a/ext/openwrt/scripts/functions/device_users
+++ b/ext/openwrt/scripts/functions/device_users
@@ -6,7 +6,7 @@ local parameter="$1"
 case "$parameter" in
        Device.Users.UserNumberOfEntries)
        local val=`wc -l /etc/passwd | awk '{ print $1 }'`
-       freecwmp_value_output "$parameter" "$val"
+       ubus_freecwmp_output "$parameter" "$val"
        return
        ;;
 esac
@@ -21,7 +21,7 @@ if [ $rc -eq 0 ]; then
        # TODO: this is very system dependent, for now just look at users shell
        local sed_cmd=`echo -n \'$num; echo p\'`
        local val=`eval sed -n $sed_cmd /etc/passwd | grep -v '/bin/false' | wc 
-l`
-       freecwmp_value_output "$parameter" "$val"
+       ubus_freecwmp_output "$parameter" "$val"
        return
 fi
 
@@ -30,7 +30,7 @@ if [ $rc -eq 0 ]; then
        # TODO: this is very system dependent, for now just look at users shell
        local sed_cmd=`echo -n \'$num; echo p\'`
        local val=`eval sed -n $sed_cmd /etc/passwd | grep -v '/bin/false' | wc 
-l`
-       freecwmp_value_output "$parameter" "$val"
+       ubus_freecwmp_output "$parameter" "$val"
        return
 fi
 
@@ -38,7 +38,7 @@ freecwmp_parse_formated_parameter "$parameter" 
"Device.Users.User.{i}.Username"
 if [ $rc -eq 0 ]; then
        local sed_cmd=`echo -n \'$num; echo p\'`
        local val=`eval sed -n $sed_cmd /etc/passwd | awk -F ':' '{ print $1 }'`
-       freecwmp_value_output "$parameter" "$val"
+       ubus_freecwmp_output "$parameter" "$val"
        return
 fi
 
@@ -48,15 +48,16 @@ if [ $rc -eq 0 ]; then
        #   local sed_cmd=`echo -n \'$num; echo p\'`
        #   local val=`eval sed -n $sed_cmd /etc/shadow | awk -F ':' '{ print 
$2 }'`
        #   freecwmp_value_output "$parameter" "$val"
-       freecwmp_value_output "$parameter" ""
+       ubus_freecwmp_output "$parameter" ""
        return
 fi
 
 freecwmp_parse_formated_parameter "$parameter" 
"Device.Users.User.{i}.Language" "rc" "num"
 if [ $rc -eq 0 ]; then
-       freecwmp_value_output "$parameter" ""
+       ubus_freecwmp_output "$parameter" ""
        return
 fi
+return $FAULT_CPE_INVALID_PARAMETER_NAME
 }
 
 set_device_users() {
-- 
1.7.4.1


<Prev in Thread] Current Thread [Next in Thread>