mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-05-31 04:44:05 +02:00
Update 93-openvpn.sh
This commit is contained in:
@@ -56,7 +56,7 @@ if bashio::config.true 'openvpn_enabled'; then
|
|||||||
cp /config/openvpn/* /etc/openvpn/
|
cp /config/openvpn/* /etc/openvpn/
|
||||||
# Standardize file
|
# Standardize file
|
||||||
cp /config/openvpn/"${openvpn_config}" /etc/openvpn/config.ovpn
|
cp /config/openvpn/"${openvpn_config}" /etc/openvpn/config.ovpn
|
||||||
|
|
||||||
# If openvpn_config not set, and folder is empty
|
# If openvpn_config not set, and folder is empty
|
||||||
else
|
else
|
||||||
bashio::exit.nok "Openvpn enabled, but no .ovpn files in the /addon_configs/$HOSTNAME/openvpn folder ! Exiting"
|
bashio::exit.nok "Openvpn enabled, but no .ovpn files in the /addon_configs/$HOSTNAME/openvpn folder ! Exiting"
|
||||||
@@ -69,7 +69,7 @@ if bashio::config.true 'openvpn_enabled'; then
|
|||||||
if grep -q "ipv6" /etc/openvpn/config.ovpn; then
|
if grep -q "ipv6" /etc/openvpn/config.ovpn; then
|
||||||
bashio::log.warning "ipv6 configured in the ovpn file but not compatible with the addon. You should remove it."
|
bashio::log.warning "ipv6 configured in the ovpn file but not compatible with the addon. You should remove it."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Set credentials
|
# Set credentials
|
||||||
if bashio::config.has_value "openvpn_username"; then
|
if bashio::config.has_value "openvpn_username"; then
|
||||||
openvpn_username=$(bashio::config 'openvpn_username')
|
openvpn_username=$(bashio::config 'openvpn_username')
|
||||||
@@ -83,7 +83,7 @@ if bashio::config.true 'openvpn_enabled'; then
|
|||||||
else
|
else
|
||||||
bashio::exit.nok "Openvpn is enabled, but openvpn_password option is empty! Exiting"
|
bashio::exit.nok "Openvpn is enabled, but openvpn_password option is empty! Exiting"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Add credentials file
|
# Add credentials file
|
||||||
if grep -q auth-user-pass /etc/openvpn/config.ovpn; then
|
if grep -q auth-user-pass /etc/openvpn/config.ovpn; then
|
||||||
sed -i "s/auth-user-pass.*/auth-user-pass \/etc\/openvpn\/credentials/g" /etc/openvpn/config.ovpn
|
sed -i "s/auth-user-pass.*/auth-user-pass \/etc\/openvpn\/credentials/g" /etc/openvpn/config.ovpn
|
||||||
|
|||||||
Reference in New Issue
Block a user