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:
@@ -45,7 +45,7 @@ handle_ip_file() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if [ "$2" != "pre-up" -a "$2" != "down" ]; then
|
if [ "$2" != "pre-up" ] && [ "$2" != "down" ]; then
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -59,7 +59,7 @@ if [ -z "$profile" ]; then
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! [ -f "$dir/rule-$profile" -o -f "$dir/rule6-$profile" ]; then
|
if [ ! -f "$dir/rule-$profile" ] && [ ! -f "$dir/rule6-$profile" ]; then
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user