diff options
author | Nicolas Stinus | 2017-02-18 10:03:53 -0300 |
---|---|---|
committer | Nicolas Stinus | 2017-02-18 10:03:53 -0300 |
commit | 347b8fb39fa07e4f1ee7e76de11c5dbcb1ae51be (patch) | |
tree | 28dc49bae95214e339535caaedb4f744d3061acc | |
parent | 3a44c8ddb0f6bf792ab6d5d768574bf478c17d78 (diff) | |
download | aur-347b8fb39fa07e4f1ee7e76de11c5dbcb1ae51be.tar.gz |
Fix tests in nordvpn script
-rwxr-xr-x | nordvpn | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -6,7 +6,7 @@ get_service() { run_ping() { remote=$(grep -E '^remote [0-9.]+ [0-9]+$' $1 | cut -d ' ' -f 2) - test ! -z $remote || exit 1 + test ! -z "$remote" || exit 1 bin=$(which ping) test $? -eq 0 || echo "ping not found, please install iputils" $bin -c 4 -A $remote | tail -n 1 | cut -d / -f 5 @@ -25,7 +25,7 @@ case $command in ;; ping) file=/etc/openvpn/client/nordvpn_${1}.conf - test -f $file || exit 1 + test -f "$file" || exit 1 run_ping $file ;; rank) @@ -39,16 +39,16 @@ case $command in ;; status) service=$(get_service) - test -z $service || systemctl status $service + test -z "$service" || systemctl status $service ;; start) service=$(get_service) - test -z $service || $0 stop + test -z "$service" || $0 stop systemctl $command openvpn-client@nordvpn_${1} ;; stop|restart) service=$(get_service) - test -z $service || systemctl $command $service + test -z "$service" || systemctl $command $service ;; *) echo "usage: $(basename $0) command [options]" |