mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-07-13 17:40:31 +02:00
config selection logic fix
This commit is contained in:
@@ -42,7 +42,6 @@ fi
|
||||
echo -e "${openvpn_username}\n${openvpn_password}" > "${OPENVPN_STATE_DIR}/credentials.conf"
|
||||
chmod 600 "${OPENVPN_STATE_DIR}/credentials.conf"
|
||||
|
||||
if bashio::config.has_value 'openvpn_config'; then
|
||||
openvpn_config="$(bashio::config 'openvpn_config')"
|
||||
openvpn_config="${openvpn_config##*/}"
|
||||
if [[ -z "${openvpn_config}" ]]; then
|
||||
@@ -64,7 +63,6 @@ if bashio::config.has_value 'openvpn_config'; then
|
||||
else
|
||||
bashio::exit.nok "OpenVPN configuration '/config/openvpn/${openvpn_config}' not found."
|
||||
fi
|
||||
fi
|
||||
|
||||
interface_name="$(sed -n "/^dev tun/p" "${openvpn_config}" | awk -F' ' '{print $2}')"
|
||||
if [[ -z "${interface_name}" ]]; then
|
||||
|
||||
@@ -25,7 +25,6 @@ bashio::log.info "------------------------------"
|
||||
bashio::log.info "Wireguard enabled, configuring"
|
||||
bashio::log.info "------------------------------"
|
||||
|
||||
if bashio::config.has_value 'wireguard_config'; then
|
||||
wireguard_config="$(bashio::config 'wireguard_config')"
|
||||
wireguard_config="${wireguard_config##*/}"
|
||||
if [[ -z "${wireguard_config}" ]]; then
|
||||
@@ -47,7 +46,6 @@ if bashio::config.has_value 'wireguard_config'; then
|
||||
else
|
||||
bashio::exit.nok "WireGuard configuration '/config/wireguard/${wireguard_config}' not found."
|
||||
fi
|
||||
fi
|
||||
|
||||
interface_name="$(basename "${wireguard_config}" .conf)"
|
||||
if [[ -z "${interface_name}" ]]; then
|
||||
|
||||
Reference in New Issue
Block a user