Fix SC2046.

This commit is contained in:
Darko Poljak 2018-10-05 11:57:31 +02:00
parent b25aff17c6
commit ed542cc7cb
3 changed files with 4 additions and 4 deletions

View file

@ -83,7 +83,7 @@ present="$(cat "$__object/explorer/present")"
status="$(cat "$__object/explorer/status")"
# Handle ip="addr, addr" format
if [ $(expr "${ip}" : ".*, .*") -gt "0" ]; then
if [ "$(expr "${ip}" : ".*, .*")" -gt "0" ]; then
SAVE_IFS="$IFS"
IFS=", "
for cur_ip in ${ip}; do

View file

@ -86,7 +86,7 @@ present="$(cat "$__object/explorer/present")"
status="$(cat "$__object/explorer/status")"
# Handle ip="iface|addr, iface|addr" format
if [ $(expr "${ip}" : ".*|.*") -gt "0" ]; then
if [ "$(expr "${ip}" : ".*|.*")" -gt "0" ]; then
# If we have multiple IPs defined, $interface doesn't make sense because ip="iface|addr, iface|addr" implies it
interface=""
SAVE_IFS="$IFS"

View file

@ -38,11 +38,11 @@ fi
pkg_version="$(cat "$__object/explorer/pkg_version")"
if [ -z "$pkg_version" ]; then
state_is="absent"
elif [ -z "$version" ] && [ $(echo "$pkg_version" | wc -l) -gt 1 ]; then
elif [ -z "$version" ] && [ "$(echo "$pkg_version" | wc -l)" -gt 1 ]; then
echo "Package name is not unique! The following packages are installed:"
echo "$pkg_version"
exit 1
elif [ -n "$version" ] && [ $(echo "$pkg_version" | cut -d " " -f 1 | sort | uniq | wc -l) -gt 1 ]; then
elif [ -n "$version" ] && [ "$(echo "$pkg_version" | cut -d " " -f 1 | sort | uniq | wc -l)" -gt 1 ]; then
echo "Package name is not unique! The following packages are installed:"
echo "$pkg_version"
exit 1