View Issue Details

IDProjectCategoryView StatusLast Update
0000303easycwmpBugpublic2018-06-25 18:42
Reporterhmh Assigned Toemna.trigui@pivasoftware.com  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
PlatformOpenWRTOSOpenWRT/LEDEOS Versionall
Summary0000303: Typos and ident fixes for the easycwmp action script for openwrt
DescriptionFix minor issues in the easycwmp action script. Each issue will have a different patch attached.

Note: one of the minor issues fixed might actually be breaking firmware updates/config updates depending on what implements /bin/sh in the target.
Additional InformationPlease consider using shellcheck on the scripts that are shipped with easycwmp...
TagsNo tags attached.
e-mail notification

Activities

hmh

2017-10-26 12:52

reporter  

011-easycwmp_fix-code-ident.patch (1,429 bytes)   
easycwmp: fix ident for openwrt action script

Fix code identation, the code is hard enough to follow as is ;-)

To-be-sent-upstream
--- a/ext/openwrt/scripts/easycwmp.sh
+++ b/ext/openwrt/scripts/easycwmp.sh
@@ -316,14 +316,14 @@ handle_action() {
 					/sbin/uci import < $dwfile
 					fault_code="$?"
 				fi
-			if [ "$fault_code" != "0" ]; then
-					let fault_code=$E_DOWNLOAD_FAILURE+9000
-				common_json_output_fault "" "$fault_code"
-			else
-				$UCI_COMMIT
-				sync
-				reboot
-				common_json_output_status "1"
+				if [ "$fault_code" != "0" ]; then
+						let fault_code=$E_DOWNLOAD_FAILURE+9000
+					common_json_output_fault "" "$fault_code"
+				else
+					$UCI_COMMIT
+					sync
+					reboot
+					common_json_output_status "1"
 				fi
 			else
 				let fault_code=$E_DOWNLOAD_FAILURE+9000
@@ -336,12 +336,12 @@ handle_action() {
 			if [ "$dwfile" != "" ]; then
 				dwfile="$DOWNLOAD_DIR/$dwfile"
 				/sbin/sysupgrade $dwfile
-			fault_code="$?"
-			if [ "$fault_code" != "0" ]; then
-				let fault_code=$E_DOWNLOAD_FAIL_FILE_CORRUPTED+9000
-				common_json_output_fault "" "$fault_code"
-			else
-				common_json_output_status "1"
+				fault_code="$?"
+				if [ "$fault_code" != "0" ]; then
+					let fault_code=$E_DOWNLOAD_FAIL_FILE_CORRUPTED+9000
+					common_json_output_fault "" "$fault_code"
+				else
+					common_json_output_status "1"
 				fi
 			else
 				let fault_code=$E_DOWNLOAD_FAILURE+9000

hmh

2017-10-26 12:52

reporter  

012-easycwmp_fix-syntax-error-on-download.patch (1,000 bytes)   
easycwmp: fix code typo on openwrt action script

Remove a stray "$" from the firmware download processing (tar.gz/tar.bz2 code
paths).  This code path is used to override/deploy new data files in
/etc/config or in /etc.

To-be-sent-upstream
--- a/ext/openwrt/scripts/easycwmp.sh
+++ b/ext/openwrt/scripts/easycwmp.sh
@@ -296,7 +296,7 @@ handle_action() {
 					tar -zxf $dwfile -C $DOWNLOAD_DIR >/dev/null 2>&1
 					fault_code="$?"
 					if [ "$fault_code" = "0" ]; then
-						if [ -d $ $DOWNLOAD_DIR/config/ ]; then
+						if [ -d $DOWNLOAD_DIR/config/ ]; then
 							cp -R $DOWNLOAD_DIR/config/* /etc/config/
 						else
 							cp -R $DOWNLOAD_DIR/* /
@@ -306,7 +306,7 @@ handle_action() {
 					tar -jxf $dwfile -C $DOWNLOAD_DIR >/dev/null 2>&1
 					fault_code="$?"
 					if [ "$fault_code" = "0" ]; then
-						if [ -d $ $DOWNLOAD_DIR/config/ ]; then
+						if [ -d $DOWNLOAD_DIR/config/ ]; then
 							cp -R $DOWNLOAD_DIR/config/* /etc/config/
 						else
 							cp -R $DOWNLOAD_DIR/* /

emna.trigui@pivasoftware.com

2018-06-25 18:42

developer   ~0000881

Delivered in EasyCwmp-1.7.0

Issue History

Date Modified Username Field Change
2017-10-26 12:51 hmh New Issue
2017-10-26 12:52 hmh File Added: 011-easycwmp_fix-code-ident.patch
2017-10-26 12:52 hmh File Added: 012-easycwmp_fix-syntax-error-on-download.patch
2018-06-25 18:42 emna.trigui@pivasoftware.com Note Added: 0000881
2018-06-25 18:42 emna.trigui@pivasoftware.com Status new => resolved
2018-06-25 18:42 emna.trigui@pivasoftware.com Resolution open => fixed
2018-06-25 18:42 emna.trigui@pivasoftware.com Assigned To => emna.trigui@pivasoftware.com