diff --git a/distribute.sh b/distribute.sh index 7401dc1..7bad545 100644 --- a/distribute.sh +++ b/distribute.sh @@ -27,7 +27,7 @@ sed '/^$/d' h | tee ./.curr_h >/dev/null # remove empty lines printf "Attempting to SSH\n" -if [[ -z "$_USERS" ]] +if [[ "$_USERS" ]] then for username in $_USERS do @@ -59,7 +59,7 @@ fi # Stores results in ./.proxy_results printf "" >.proxy_results -if [[ -z "$_PROXY_ROUTES" ]] +if [[ "$_PROXY_ROUTES" ]] then for proxy in $_PROXY_ROUTES do @@ -103,7 +103,7 @@ mv .curr_h .discards_h # Print Result printf "Printing results:\n" -if [[ -z "$_USERS" ]] +if [[ "$_USERS" ]] then for username in $_USERS do diff --git a/send_files.sh b/send_files.sh index 1a83696..1d4b32e 100644 --- a/send_files.sh +++ b/send_files.sh @@ -24,7 +24,7 @@ _SSH_TIMOUT=7 printf "Sending files to /tmp\n" -if [[ -z "$_USERS" ]] +if [[ "$_USERS" ]] then for username in $_USERS do @@ -52,7 +52,7 @@ fi # Copy files to proxy host PROXY_IN_RESULTS=$(awk -F ';' '{print $2}' ./.proxy_results | sort | uniq) -if [[ -z "$PROXY_IN_RESULTS" ]] +if [[ "$PROXY_IN_RESULTS" ]] then for _proxy in $PROXY_IN_RESULTS do @@ -80,7 +80,7 @@ printf "Sending files from proxy hosts\n" # Copy files from proxy to remote PROXY_SORTED_LINES=$(sort -t ';' -k2 ./.proxy_results) -if [[ -z "$PROXY_SORTED_LINES" ]] +if [[ "$PROXY_SORTED_LINES" ]] then while IFS= read -r _LINE do