]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
vstart.sh: use || instead of "-o" 41545/head
authorKefu Chai <kchai@redhat.com>
Wed, 26 May 2021 06:02:51 +0000 (14:02 +0800)
committerKefu Chai <kchai@redhat.com>
Wed, 26 May 2021 06:02:53 +0000 (14:02 +0800)
to silence the warning like:

 SC2166: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined.

see also
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/test.html

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/vstart.sh

index 8bd32bd074618827963bdcb34f0a1881e9556fe3..c7797025d688cf22c7222052fd7c2994074acf6f 100755 (executable)
@@ -253,9 +253,10 @@ parse_block_devs() {
     shift
     local devs=$1
     shift
+    local dev
     IFS=',' read -r -a block_devs <<< "$devs"
     for dev in "${block_devs[@]}"; do
-        if [ ! -b $dev -o ! -w $dev ]; then
+        if [ ! -b $dev ] || [ ! -w $dev ]; then
             echo "All $opt_name must refer to writable block devices"
             exit 1
         fi