From: Rafał Miłecki Date: Sun, 14 Jul 2019 20:11:40 +0000 (+0200) Subject: orion: sysupgrade: change platform_check_image() args validation X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=bf4eef46b45932c9ec1ea9ed9f2b4dc64062e7f9;p=openwrt%2Fstaging%2Fstintel.git orion: sysupgrade: change platform_check_image() args validation sysupgrade passes image to check as argument so use $# instead of $ARGC. It also fits this function better as it checks $1 and not $ARGV. Signed-off-by: Rafał Miłecki --- 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")"