summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2018-10-04 09:36:38 +0200
committerBeniamino Galvani <bgalvani@redhat.com>2018-10-06 10:03:48 +0200
commit56a599f79197bd15402bcfedc0cb87ed4f6ebdb6 (patch)
tree5349d0751df7bab8294ecbec6fa13383a4864676
parent40f6cfb58e338a78eaf4d59841ecf0af6837b51d (diff)
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-xexamples/dispatcher/10-ifcfg-rh-routes.sh4
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 147506e47..d72400aed 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