Skip to content

Commit

Permalink
disconnect when restarting
Browse files Browse the repository at this point in the history
adding PASSFILE back
  • Loading branch information
Julio Guti committed Oct 16, 2021
1 parent 9efc5f1 commit 45bf68e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions rootfs/usr/bin/nord_login
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/with-contenv bash

[[ -z "${PASS}" ]] && [[ -f "${PASSFILE}" ]] && PASS="$(head -n 1 "${PASSFILE}")"
nordvpn login --username "${USER}" --password "${PASS}" || {
echo "Invalid Username or password."
exit 1
Expand Down
2 changes: 1 addition & 1 deletion rootfs/usr/bin/nord_watch
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ while true; do
if [[ ! $(curl -Is -m 30 -o /dev/null -w "%{http_code}" "${CHECK_CONNECTION_URL:-www.google.com}") =~ ^[23] ]]; then
echo "Unstable connection detected!"
nordvpn status

nordvpn disconnect
s6-svc -wR -t /var/run/s6/services/nordvpn
nord_connect
fi
Expand Down

0 comments on commit 45bf68e

Please sign in to comment.