diff options
author | Beniamino Galvani <bgalvani@redhat.com> | 2018-10-04 09:36:38 +0200 |
---|---|---|
committer | Beniamino Galvani <bgalvani@redhat.com> | 2018-10-06 10:03:48 +0200 |
commit | 9e43821e1741e2800df00f71ced0569629b032ab (patch) | |
tree | 5349d0751df7bab8294ecbec6fa13383a4864676 | |
parent | 27ab932a499e300b966ef387d9ed4cac4d3b2b4c (diff) | |
download | NetworkManager-9e43821e1741e2800df00f71ced0569629b032ab.tar.gz |
dispatcher: fix shellcheck warnings
Prefer [ p ] && [ q ] as [ p -a q ] is not well defined.
And likewise, prefer [ p ] || [ q ] over [ p -o q ].
https://github.com/koalaman/shellcheck/wiki/SC2166
-rwxr-xr-x | examples/dispatcher/10-ifcfg-rh-routes.sh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/dispatcher/10-ifcfg-rh-routes.sh b/examples/dispatcher/10-ifcfg-rh-routes.sh index 147506e471..d72400aed7 100755 --- a/examples/dispatcher/10-ifcfg-rh-routes.sh +++ b/examples/dispatcher/10-ifcfg-rh-routes.sh @@ -45,7 +45,7 @@ handle_ip_file() { } -if [ "$2" != "pre-up" -a "$2" != "down" ]; then +if [ "$2" != "pre-up" ] && [ "$2" != "down" ]; then exit 0 fi @@ -59,7 +59,7 @@ if [ -z "$profile" ]; then exit 0 fi -if ! [ -f "$dir/rule-$profile" -o -f "$dir/rule6-$profile" ]; then +if [ ! -f "$dir/rule-$profile" ] && [ ! -f "$dir/rule6-$profile" ]; then exit 0 fi |