Added quotes around some ${VPN_CONFIG}'s
This commit is contained in:
parent
fd5f1e358f
commit
928b5a9633
@ -99,13 +99,13 @@ if [[ $VPN_ENABLED == "yes" ]]; then
|
||||
echo "${VPN_PASSWORD}" >> /config/openvpn/credentials.conf
|
||||
|
||||
# Replace line with one that points to credentials.conf
|
||||
auth_cred_exist=$(cat ${VPN_CONFIG} | grep -m 1 'auth-user-pass')
|
||||
auth_cred_exist=$(cat "${VPN_CONFIG}" | grep -m 1 'auth-user-pass')
|
||||
if [[ ! -z "${auth_cred_exist}" ]]; then
|
||||
# Get line number of auth-user-pass
|
||||
LINE_NUM=$(grep -Fn -m 1 'auth-user-pass' ${VPN_CONFIG} | cut -d: -f 1)
|
||||
sed -i "${LINE_NUM}s/.*/auth-user-pass credentials.conf/" ${VPN_CONFIG}
|
||||
LINE_NUM=$(grep -Fn -m 1 'auth-user-pass' "${VPN_CONFIG}" | cut -d: -f 1)
|
||||
sed -i "${LINE_NUM}s/.*/auth-user-pass credentials.conf/" "${VPN_CONFIG}"
|
||||
else
|
||||
sed -i "1s/.*/auth-user-pass credentials.conf/" ${VPN_CONFIG}
|
||||
sed -i "1s/.*/auth-user-pass credentials.conf/" "${VPN_CONFIG}"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
@ -259,7 +259,7 @@ if [[ $VPN_ENABLED == "yes" ]]; then
|
||||
if [[ "${VPN_TYPE}" == "openvpn" ]]; then
|
||||
echo "[INFO] Starting OpenVPN..." | ts '%Y-%m-%d %H:%M:%.S'
|
||||
cd /config/openvpn
|
||||
exec openvpn --config ${VPN_CONFIG} &
|
||||
exec openvpn --config "${VPN_CONFIG}" &
|
||||
#exec /bin/bash /etc/openvpn/openvpn.init start &
|
||||
else
|
||||
echo "[INFO] Starting WireGuard..." | ts '%Y-%m-%d %H:%M:%.S'
|
||||
|
Loading…
x
Reference in New Issue
Block a user