This commit is contained in:
Hans Karlinius
2024-12-01 09:05:36 +01:00
parent 16b1fd12b5
commit cb43bd7793
9 changed files with 44 additions and 23 deletions

View File

@@ -2,17 +2,38 @@
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')
clientid=$(echo $options | jq '.clientid | tostring')
manualhub=$(echo $options | jq '.manualhub | tostring')
if $autofind; then
bashio::log.info "Enable AutoFind"
bashio::log.info "Enable General AutoFind"
/usr/bin/vh_edit_config General AutoFind 1
else
bashio::log.info "Disable AutoFind"
bashio::log.info "Disable General AutoFind"
/usr/bin/vh_edit_config General AutoFind 0
fi
if bashio::config.has_value 'clientid'; then
clientid=($(bashio::config 'clientid'))
bashio::log.info "Set ClientId to ${clientid}"
if $autouse; then
bashio::log.info "Enable AutoShare All"
/usr/bin/vh_edit_config AutoShare All 1
else
bashio::log.info "Disable AutoShare"
/usr/bin/vh_edit_config AutoShare All 0
fi
#if bashio::config.has_value 'clientid'; then
if ${clientid+:} ; then
#clientid=($(bashio::config 'clientid'))
bashio::log.info "Set General ClientId to ${clientid}"
/usr/bin/vh_edit_config General ClientId ${clientid}
fi
if ${manualhub+:} ; then
bashio::log.info "Set Settings ManualHubs to ${manualhub}"
/usr/bin/vh_edit_config Settings ManualHubs ${manualhub}
else
bashio::log.info "Set Settings ManualHubs to null"
/usr/bin/vh_edit_config Settings ManualHubs null
fi