Skip to content

Commit

Permalink
Add check if OVPN profile exists
Browse files Browse the repository at this point in the history
  • Loading branch information
Zack7777 committed Nov 25, 2020
1 parent a01df45 commit a2f74d2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/ovpn/run
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ fi

if [ -n "$REGION" ]; then
REGION=$(echo $REGION | sed 's/ /_/g' | tr '[:upper:]' '[:lower:]')
if [[ ! -f "/config/pia/${REGION}.ovpn" ]]; then
echo "ERROR: OpenVPN configuration profile not found, check your REGION environment variable, see https://www.privateinternetaccess.com/pages/network/dkrpia for possible choices"
exit 1
fi
set -- "$@" '--config' "/config/pia/${REGION}.ovpn"
else
echo "REGION environment variable is not set. Exiting."
Expand Down

0 comments on commit a2f74d2

Please sign in to comment.