mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-06-23 07:46:05 +02:00
Check for openvpn_config option to avoid assigning string "null" to variable
This commit is contained in:
@@ -42,8 +42,10 @@ 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"
|
||||||
|
|
||||||
openvpn_config="$(bashio::config 'openvpn_config')"
|
if bashio::config.has_value "openvpn_config"; then
|
||||||
openvpn_config="${openvpn_config##*/}"
|
openvpn_config="$(bashio::config 'openvpn_config')"
|
||||||
|
openvpn_config="${openvpn_config##*/}"
|
||||||
|
fi
|
||||||
if [[ -z "${openvpn_config}" ]]; then
|
if [[ -z "${openvpn_config}" ]]; then
|
||||||
bashio::log.info 'openvpn_config option left empty. Attempting automatic selection.'
|
bashio::log.info 'openvpn_config option left empty. Attempting automatic selection.'
|
||||||
mapfile -t configs < <(find /config/openvpn -maxdepth 1 \( -type f -name '*.conf' -o -name '*.ovpn' \) -print)
|
mapfile -t configs < <(find /config/openvpn -maxdepth 1 \( -type f -name '*.conf' -o -name '*.ovpn' \) -print)
|
||||||
|
|||||||
Reference in New Issue
Block a user