[OpenWrt-Devel] [PATCH] orion: sysupgrade: change platform_check_image() args validation

Rafał Miłecki zajec5 at gmail.com
Sun Jul 14 16:11:40 EDT 2019


From: Rafał Miłecki <rafal at milecki.pl>

sysupgrade passes image to check as argument so use $# instead of $ARGC

Signed-off-by: Rafał Miłecki <rafal at milecki.pl>
---
 target/linux/orion/generic/base-files/lib/upgrade/platform.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/orion/generic/base-files/lib/upgrade/platform.sh b/target/linux/orion/generic/base-files/lib/upgrade/platform.sh
index db2330684d..cf1fad83a8 100644
--- a/target/linux/orion/generic/base-files/lib/upgrade/platform.sh
+++ b/target/linux/orion/generic/base-files/lib/upgrade/platform.sh
@@ -6,7 +6,7 @@
 # use default for platform_do_upgrade()
 
 platform_check_image() {
-	[ "${ARGC}" -gt 1 ] && { echo 'Too many arguments. Only flash file expected.'; return 1; }
+	[ "$#" -gt 1 ] && { echo 'Too many arguments. Only flash file expected.'; return 1; }
 
 	local hardware="$(board_name)"
 	local magic="$(get_magic_word "$1")"
-- 
2.21.0


_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list