Create new CREATE_TUN_DEVICE variable

This commit is contained in:
wilmardo
2019-02-26 20:55:57 +01:00
parent aaa57d1b30
commit 614ea60b8c
2 changed files with 11 additions and 3 deletions

View File

@@ -2,6 +2,13 @@
VPN_PROVIDER="${OPENVPN_PROVIDER,,}"
VPN_PROVIDER_CONFIGS="/etc/openvpn/${VPN_PROVIDER}"
# If create_tun_device is set, create /dev/net/tun
if [[ "${CREATE_TUN_DEVICE,,}" == "true" ]]; then
mkdir -p /dev/net
mknod /dev/net/tun c 10 200
chmod 0666 /dev/net/tun
fi
if [[ "${OPENVPN_PROVIDER}" == "**None**" ]] || [[ -z "${OPENVPN_PROVIDER-}" ]]; then
echo "OpenVPN provider not set. Exiting."
exit 1