config selection logic fix

This commit is contained in:
litinoveweedle
2026-02-03 23:16:56 +01:00
parent 81287577a2
commit 5daf3c240f
2 changed files with 36 additions and 40 deletions

View File

@@ -42,7 +42,6 @@ fi
echo -e "${openvpn_username}\n${openvpn_password}" > "${OPENVPN_STATE_DIR}/credentials.conf" echo -e "${openvpn_username}\n${openvpn_password}" > "${OPENVPN_STATE_DIR}/credentials.conf"
chmod 600 "${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="$(bashio::config 'openvpn_config')"
openvpn_config="${openvpn_config##*/}" openvpn_config="${openvpn_config##*/}"
if [[ -z "${openvpn_config}" ]]; then if [[ -z "${openvpn_config}" ]]; then
@@ -64,7 +63,6 @@ if bashio::config.has_value 'openvpn_config'; then
else else
bashio::exit.nok "OpenVPN configuration '/config/openvpn/${openvpn_config}' not found." bashio::exit.nok "OpenVPN configuration '/config/openvpn/${openvpn_config}' not found."
fi fi
fi
interface_name="$(sed -n "/^dev tun/p" "${openvpn_config}" | awk -F' ' '{print $2}')" interface_name="$(sed -n "/^dev tun/p" "${openvpn_config}" | awk -F' ' '{print $2}')"
if [[ -z "${interface_name}" ]]; then if [[ -z "${interface_name}" ]]; then

View File

@@ -25,7 +25,6 @@ bashio::log.info "------------------------------"
bashio::log.info "Wireguard enabled, configuring" bashio::log.info "Wireguard enabled, configuring"
bashio::log.info "------------------------------" bashio::log.info "------------------------------"
if bashio::config.has_value 'wireguard_config'; then
wireguard_config="$(bashio::config 'wireguard_config')" wireguard_config="$(bashio::config 'wireguard_config')"
wireguard_config="${wireguard_config##*/}" wireguard_config="${wireguard_config##*/}"
if [[ -z "${wireguard_config}" ]]; then if [[ -z "${wireguard_config}" ]]; then
@@ -47,7 +46,6 @@ if bashio::config.has_value 'wireguard_config'; then
else else
bashio::exit.nok "WireGuard configuration '/config/wireguard/${wireguard_config}' not found." bashio::exit.nok "WireGuard configuration '/config/wireguard/${wireguard_config}' not found."
fi fi
fi
interface_name="$(basename "${wireguard_config}" .conf)" interface_name="$(basename "${wireguard_config}" .conf)"
if [[ -z "${interface_name}" ]]; then if [[ -z "${interface_name}" ]]; then