summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Stinus2017-02-18 10:03:53 -0300
committerNicolas Stinus2017-02-18 10:03:53 -0300
commit347b8fb39fa07e4f1ee7e76de11c5dbcb1ae51be (patch)
tree28dc49bae95214e339535caaedb4f744d3061acc
parent3a44c8ddb0f6bf792ab6d5d768574bf478c17d78 (diff)
downloadaur-347b8fb39fa07e4f1ee7e76de11c5dbcb1ae51be.tar.gz
Fix tests in nordvpn script
-rwxr-xr-xnordvpn10
1 files changed, 5 insertions, 5 deletions
diff --git a/nordvpn b/nordvpn
index 8f07007b2616..438b538b4605 100755
--- a/nordvpn
+++ b/nordvpn
@@ -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]"