Fixes #6 (forgot quotes for $REGION.ovpn)

This commit is contained in:
Quentin McGaw
2018-10-08 08:45:02 +02:00
parent e0f201a334
commit d12f44fd6b

View File

@@ -7,6 +7,12 @@ printf "\n ========================================="
printf "\n =========================================" printf "\n ========================================="
printf "\n == by github.com/qdm12 - Quentin McGaw ==\n" printf "\n == by github.com/qdm12 - Quentin McGaw ==\n"
############################################
# CHECK PARAMETERS
############################################
cat "/openvpn-$PROTOCOL-$ENCRYPTION/$REGION.ovpn" &> /dev/null
if [[ "$?" != 0 ]]; then printf "/openvpn-$PROTOCOL-$ENCRYPTION/$REGION.ovpn is not accessible\nSleeping for 10 seconds before exit...\n"; sleep 10; exit 1; fi
############################################ ############################################
# CHECK FOR TUN DEVICE # CHECK FOR TUN DEVICE
############################################ ############################################
@@ -155,5 +161,6 @@ printf "\n * Port: $PORT"
printf "\n * Initial IP address: $(echo $VPNIPS | cut -d' ' -f1)" printf "\n * Initial IP address: $(echo $VPNIPS | cut -d' ' -f1)"
printf "\n\n" printf "\n\n"
cd "/openvpn-$PROTOCOL-$ENCRYPTION" cd "/openvpn-$PROTOCOL-$ENCRYPTION"
openvpn --config $REGION.ovpn --user nonrootuser --persist-tun --auth-retry nointeract --auth-user-pass /auth.conf --auth-nocache openvpn --config "$REGION.ovpn" --user nonrootuser --persist-tun --auth-retry nointeract --auth-user-pass /auth.conf --auth-nocache
printf "\n\nOpenVPN exited with status $?\n" status=$?
printf "\nOpenVPN exited with status $status\n"