summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorRanieri Althoff2019-05-11 02:11:05 -0300
committerRanieri Althoff2019-05-11 17:18:29 -0300
commit794d166b95a2c312578238121403eaad8783b7dd (patch)
treeb90959bbf7262767d231b2a06c493928a61f97b0
parent4fe31ac24962953d8d5324a83c9276de91d17546 (diff)
downloadaur-794d166b95a2c312578238121403eaad8783b7dd.tar.gz
Improve failure messages
-rwxr-xr-xnordconnect8
1 files changed, 4 insertions, 4 deletions
diff --git a/nordconnect b/nordconnect
index 97fa265d566..66ee8d21e0d 100755
--- a/nordconnect
+++ b/nordconnect
@@ -12,12 +12,12 @@ connect() {
PORT="$1"
SERVER="$2"
- echo "Connecting to server ${SERVER} on port ${PORT}"
-
[ -f "$CREDENTIALS" ] || die "Please run ${0} --init before connecting for the first time."
CONFIG_FILE="${FILES_FOLDER}/ovpn_${PORT}/${SERVER}.nordvpn.com.${PORT}.ovpn"
- [ -f "$CONFIG_FILE" ] || update
+ [ -f "$CONFIG_FILE" ] || die "Server ${SERVER} not found, try running ${0} --update"
+
+ echo "Connecting to server ${SERVER} on port ${PORT}"
LOGS_FOLDER="${CONFIG}/logs"
[ -d "$LOGS_FOLDER" ] || mkdir -p "$LOGS_FOLDER"
@@ -133,7 +133,7 @@ update() {
-o "$OUTPUT_FILE" \
"$URL";;
*) die 'Here be dragons';;
- esac
+ esac || die "Could not download $URL!"
[ -d "$FILES_FOLDER" ] || mkdir -p "$FILES_FOLDER"