[openwrt/openwrt] scripts/gen_image_generic.sh: replace -o with if/&&

LEDE Commits lede-commits at lists.infradead.org
Sat Jul 11 09:54:52 EDT 2020


ynezz pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/3819337cdf8c0c8f0807c000b01ac0c2f13c02c7

commit 3819337cdf8c0c8f0807c000b01ac0c2f13c02c7
Author: Rosen Penev <rosenp at gmail.com>
AuthorDate: Sun Jan 5 18:22:54 2020 -0800

    scripts/gen_image_generic.sh: replace -o with if/&&
    
    -o is not well defined.
    
    Found with shellcheck.
    
    Signed-off-by: Rosen Penev <rosenp at gmail.com>
---
 scripts/gen_image_generic.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/gen_image_generic.sh b/scripts/gen_image_generic.sh
index 53f73dc6e1..8091d95575 100755
--- a/scripts/gen_image_generic.sh
+++ b/scripts/gen_image_generic.sh
@@ -1,10 +1,10 @@
 #!/usr/bin/env bash
 # Copyright (C) 2006-2012 OpenWrt.org
 set -e -x
-[ $# == 5 -o $# == 6 ] || {
+if [ $# -ne 5 ] && [ $# -ne 6 ]; then
     echo "SYNTAX: $0 <file> <kernel size> <kernel directory> <rootfs size> <rootfs image> [<align>]"
     exit 1
-}
+fi
 
 OUTPUT="$1"
 KERNELSIZE="$2"



More information about the lede-commits mailing list