From 262559b5136f54aa307b694535defc788dd6bde5 Mon Sep 17 00:00:00 2001 From: MarkusMcNugen Date: Fri, 2 Feb 2018 20:44:23 -0500 Subject: [PATCH] Update start.sh --- openvpn/start.sh | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/openvpn/start.sh b/openvpn/start.sh index 9e5b2f1..a5d659f 100755 --- a/openvpn/start.sh +++ b/openvpn/start.sh @@ -3,25 +3,26 @@ set -x # create directory to store openvpn config files if [ ! -d "/config/openvpn" ]; then - mkdir -p /config/openvpn + mkdir -p /config/openvpn fi #Locate first file with .ovpn extension export VPN_CONFIG=$(find /config/openvpn -maxdepth 1 -name "*.ovpn" -print -quit) if [[ -z "${VPN_CONFIG}" ]]; then - echo "No ovpn file found. Add one to /config/openvpon abd restart this container, exiting..." | ts '%Y-%m-%d %H:%M:%.S' && exit 1 + echo "No ovpn file found. Add one to /config/openvpon abd restart this container, exiting..." | ts '%Y-%m-%d %H:%M:%.S' && exit 1 fi # add OpenVPN user/pass if [ "${OPENVPN_USERNAME}" = "**None**" ] || [ "${OPENVPN_PASSWORD}" = "**None**" ] ; then - echo "OpenVPN credentials not set. Exiting." - exit 1 + echo "OpenVPN credentials not set. Exiting." + exit 1 else - echo "Setting OPENVPN credentials..." - echo $OPENVPN_USERNAME > /config/openvpn/credentials.conf - echo $OPENVPN_PASSWORD >> /config/openvpn/credentials.conf - chmod 775 /config/openvpn/credentials.conf + echo "Setting OPENVPN credentials..." + echo $OPENVPN_USERNAME > /config/openvpn/credentials.conf + echo $OPENVPN_PASSWORD >> /config/openvpn/credentials.conf + chown -R "${PUID}":"${PGID}" /config/openvpn + chmod -R 775 /config/openvpn fi exec openvpn --config "$VPN_CONFIG"