mirror of
https://github.com/MarkusMcNugen/docker-qBittorrentvpn
synced 2024-11-23 02:54:57 +00:00
Update start.sh
This commit is contained in:
parent
5d96e6e6d0
commit
768642b92f
@ -51,12 +51,11 @@ if [[ $VPN_ENABLED == "yes" ]]; then
|
|||||||
echo "${VPN_USERNAME}" > /config/openvpn/credentials.conf
|
echo "${VPN_USERNAME}" > /config/openvpn/credentials.conf
|
||||||
echo "${VPN_PASSWORD}" >> /config/openvpn/credentials.conf
|
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')
|
||||||
|
if [[ ! -z "${auth_cred_exist}" ]]; then
|
||||||
# Get line number of auth-user-pass
|
# Get line number of auth-user-pass
|
||||||
LINE_NUM=$(grep -Fn -m 1 'auth-user-pass' ${VPN_CONFIG} | cut -d: -f 1)
|
LINE_NUM=$(grep -Fn -m 1 'auth-user-pass' ${VPN_CONFIG} | cut -d: -f 1)
|
||||||
|
|
||||||
# Replace line with one that points to credentials.conf
|
|
||||||
auth_cred_exist=$(cat ${VPN_CONFIG} | grep -m 1 'auth-user-pass credentials.conf')
|
|
||||||
if [[ -z "${auth_cred_exist}" ]]; then
|
|
||||||
sed -i "${LINE_NUM}s/^/auth-user-pass credentials.conf\n/" ${VPN_CONFIG}
|
sed -i "${LINE_NUM}s/^/auth-user-pass credentials.conf\n/" ${VPN_CONFIG}
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user