From 0a841546d9d96e49be516e82fbb71174ac92426f Mon Sep 17 00:00:00 2001 From: Babak Farrokhi Date: Sat, 6 Aug 2016 12:14:38 +0430 Subject: [PATCH] Improve condition checks --- multiping_ | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/multiping_ b/multiping_ index 4e6aaf6..f62ef32 100755 --- a/multiping_ +++ b/multiping_ @@ -48,7 +48,7 @@ IPS=`ifconfig ${interface} | awk '/inet /{print $2}' | grep -Ev '^(10|192)\.'` if [ $# -lt 1 ]; then - if [ "x${SRC}" == "x" ]; then + if [ -z ${SRC} ]; then echo "should run from symlink" exit 1 fi @@ -80,12 +80,12 @@ elif [ "$1" == "suggest" ]; then elif [ "$1" == "autoconf" ]; then - if [ "x${hosts}" == "x" ]; then + if [ -z ${hosts} ]; then echo "no (env.hosts is not defined)" exit 1 fi - if [ "x${interface}" == "x" ]; then + if [ -z ${interface} ]; then echo "no (env.interface is not defined)" exit 1 fi @@ -96,7 +96,7 @@ elif [ "$1" == "autoconf" ]; then elif [ "$1" == "config" ]; then - if [ "x${SRC}" == "x" ]; then + if [ -z ${SRC} ]; then exit 1 fi