This commit is contained in:
Hans Karlinius
2024-12-01 05:35:08 +01:00
parent e56df7db03
commit a077be3c4c
8 changed files with 32 additions and 29 deletions
@@ -1,14 +1,8 @@
#!/command/with-contenv bashio
if bashio::config.has_value 'autofind'; then
autofind=($(bashio::config 'autofind'))
bashio::log.info "Set AUTOFIND hub to ${autofind}"
if [ "${autofind}" = "true" ]; then
/usr/bin/vh_edit_config General AutoFind 1
else
/usr/bin/vh_edit_config General AutoFind 0
fi
fi
options=$(bashio::api.supervisor GET "/addons/self/options/config")
autofind=$(echo $options | jq '. | if .autofind then true else false end')
autouse=$(echo $options | jq '. | if .autouse then true else false end')
if bashio::config.has_value 'clientid'; then
clientid=($(bashio::config 'clientid'))
@@ -22,9 +16,21 @@ if bashio::config.has_value 'manualhub'; then
/usr/bin/vhclient -t "MANUAL HUB ADD,${manualhub}"
fi
if bashio::config.has_value 'autouse'; then
autouse=($(bashio::config 'autouse'))
if [ "${autouse}" = "true" ]; then
#if bashio::config.has_value 'autofind'; then
#autofind=($(bashio::config 'autofind'))
bashio::log.info "Set AUTOFIND hub to ${autofind}"
#if [ "${autofind}" = "true" ]; then
if $autofind; then
/usr/bin/vh_edit_config General AutoFind 1
else
/usr/bin/vh_edit_config General AutoFind 0
fi
#fi
#if bashio::config.has_value 'autouse'; then
#autouse=($(bashio::config 'autouse'))
#if [ "${autouse}" = "true" ]; then
if $autouse; then
bashio::log.info "AUTO USE ALL"
/usr/bin/vhclient -t "AUTO USE ALL"
else
@@ -33,4 +39,4 @@ if bashio::config.has_value 'autouse'; then
bashio::log.info "STOP USING ALL LOCAL"
/usr/bin/vhclient -t "STOP USING ALL LOCAL"
fi
fi
#fi