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
This commit is contained in:
Beniamino Galvani
2018-10-04 09:36:38 +02:00
parent 27ab932a49
commit 9e43821e17

View File

@@ -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