From faa3972ab42e528334958f69ac1bab956feb9cda Mon Sep 17 00:00:00 2001 From: Kristian Haugene Date: Sun, 10 May 2015 18:30:28 +0200 Subject: [PATCH] Not starting if PIA credentials is not set --- Dockerfile | 4 +--- runOpenVpn.sh | 8 ++++---- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 789c96b..ac18e38 100644 --- a/Dockerfile +++ b/Dockerfile @@ -28,9 +28,7 @@ ADD transmission/runUpdates.sh /etc/transmission-daemon/startPortUpdates.sh ADD transmission/down.sh /etc/transmission-daemon/stop.sh ADD runOpenVpn.sh /etc/openvpn/start.sh -ENV PIA_USERNAME=**None** \ - PIA_PASSWORD=**None** \ - "TRANSMISSION_ALT_SPEED_DOWN=50" \ +ENV "TRANSMISSION_ALT_SPEED_DOWN=50" \ "TRANSMISSION_ALT_SPEED_ENABLED=false" \ "TRANSMISSION_ALT_SPEED_TIME_BEGIN=540" \ "TRANSMISSION_ALT_SPEED_TIME_DAY=127" \ diff --git a/runOpenVpn.sh b/runOpenVpn.sh index dffa00e..7985be7 100755 --- a/runOpenVpn.sh +++ b/runOpenVpn.sh @@ -24,14 +24,14 @@ then fi # add PIA user/pass -if [ "$PIA_USERNAME" != "**None**" ]; -then +if [ -z "$PIA_USERNAME" ] || [ -z "$PIA_PASSWORD" ] ; then + echo "PIA credentials not set. Exiting." + exit 1 +else echo "Setting PIA credentials..." mkdir -p /config echo $PIA_USERNAME > /config/pia-credentials.txt echo $PIA_PASSWORD >> /config/pia-credentials.txt -else - echo "Not setting PIA credentials." fi dockerize \