]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-run: fix string comparison around --no-restart 53393/head
authorRadosław Zarzyński <rzarzyns@redhat.com>
Fri, 8 Sep 2023 11:50:01 +0000 (13:50 +0200)
committerRadosław Zarzyński <rzarzyns@redhat.com>
Mon, 11 Sep 2023 15:02:57 +0000 (17:02 +0200)
`man test` says the stirng equality operator is `=`:

```
       STRING1 = STRING2
              the strings are equal
```

Also, we should handle the argument-less case which currently
fails:

```
$ [ $1 == "--no-restart" ]
bash: [: ==: unary operator expected
```

Signed-off-by: Radosław Zarzyński <rzarzyns@redhat.com>
src/ceph-run

index 764101c564f84d639a3321200a47773b8570cd14..c28244d90f83e59c0a636b9deeb93cd78d75a2cb 100755 (executable)
@@ -3,7 +3,7 @@
 sleep=5
 no_restart=0
 
-if [ $1 == "--no-restart" ]; then
+if [ "$1" = "--no-restart" ]; then
     no_restart=1
     shift
 fi