freecwmp
[Top] [All Lists]

ubus data model patch [07/27]

To: freecwmp@linux-mips.org, freecwmp@lukaperkov.net
Subject: ubus data model patch [07/27]
From: KALLEL Mohamed <mohamed.kallel@pivasoftware.com>
Date: Thu, 06 Dec 2012 14:41:33 +0100
Original-recipient: rfc822;freecwmp@linux-mips.org
Sender: freecwmp-bounce@linux-mips.org
User-agent: Mozilla/5.0 (Windows NT 6.1; rv:17.0) Gecko/17.0 Thunderbird/17.0
Hi Luka

  ubus data model patch [07/27] enclosed

Regards
MOHAMED Kallel

------------------------ubus data model patch [07/27] ---------------------------------


>From 33dbf86bc1acdb5b12589225de0fa1c79c51627b Mon Sep 17 00:00:00 2001
From: Mohamed <mohamed.kallel@pivasoftware.com>
Date: Sat, 1 Dec 2012 21:05:26 +0100
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


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>
  • ubus data model patch [07/27], KALLEL Mohamed <=