View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] |
ID | Project | Category | View Status | Date Submitted | Last Update |
0000303 | easycwmp | [All Projects] Bug | public | 2017-10-26 12:51 | 2018-06-25 18:42 |
|
Reporter | hmh | |
Assigned To | emna.trigui@pivasoftware.com | |
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | fixed | |
Platform | OpenWRT | OS | OpenWRT/LEDE | OS Version | all |
|
Summary | 0000303: Typos and ident fixes for the easycwmp action script for openwrt |
Description | Fix 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 Information | Please consider using shellcheck on the scripts that are shipped with easycwmp... |
Tags | No tags attached. |
|
Attached Files | 011-easycwmp_fix-code-ident.patch [^] (1,429 bytes) 2017-10-26 12:52 [Show Content] [Hide Content]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
012-easycwmp_fix-syntax-error-on-download.patch [^] (1,000 bytes) 2017-10-26 12:52 [Show Content] [Hide Content]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/* /
|
|