mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-03-29 10:12:30 +02:00
fix: randomly select OpenVPN config when multiple files found
Co-authored-by: alexbelgium <44178713+alexbelgium@users.noreply.github.com> Agent-Logs-Url: https://github.com/alexbelgium/hassio-addons/sessions/a34bc8b0-0350-43ea-8402-d16b6a4c5b36
This commit is contained in:
@@ -66,8 +66,8 @@ if [[ -z "${openvpn_config}" ]]; then
|
||||
openvpn_config='/config/openvpn/config.conf'
|
||||
bashio::log.info 'Using default OpenVPN configuration config.conf.'
|
||||
else
|
||||
bashio::log.fatal "Multiple OpenVPN configuration files detected. Please set the 'openvpn_config' option."
|
||||
bashio::addon.stop
|
||||
openvpn_config="${configs[RANDOM % ${#configs[@]}]}"
|
||||
bashio::log.info "Multiple OpenVPN configurations found. Randomly selected: ${openvpn_config##*/}."
|
||||
fi
|
||||
elif bashio::fs.file_exists "/config/openvpn/${openvpn_config}"; then
|
||||
openvpn_config="/config/openvpn/${openvpn_config}"
|
||||
|
||||
Reference in New Issue
Block a user