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

@@ -30,7 +30,6 @@ usb: true
usbip: true
kernel_modules: true
options:
updateconfig: true
autouse: true
autofind: true
clientid: ''
@@ -46,6 +45,7 @@ schema:
device: str?,
use: bool?
}]
preventconfig: bool
stage: experimental
init: false

View File

@@ -1,8 +1,8 @@
#!/command/with-contenv bashio
options=$(bashio::api.supervisor GET "/addons/self/options/config")
#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')
#autouse=$(echo $options | jq '. | if .autouse then true else false end')
#if $autofind; then
# bashio::log.info "Enable AutoFind"
@@ -12,15 +12,15 @@ autouse=$(echo $options | jq '. | if .autouse then true else false end')
# /usr/bin/vh_edit_config General AutoFind 0
#fi
if $autouse; then
bashio::log.info "AUTO USE ALL"
/usr/bin/vhclient -t "AUTO USE ALL"
else
bashio::log.info "AUTO USE CLEAR ALL"
/usr/bin/vhclient -t "AUTO USE CLEAR ALL"
bashio::log.info "STOP USING ALL LOCAL"
/usr/bin/vhclient -t "STOP USING ALL LOCAL"
fi
#if $autouse; then
# bashio::log.info "AUTO USE ALL"
# /usr/bin/vhclient -t "AUTO USE ALL"
#else
# bashio::log.info "AUTO USE CLEAR ALL"
# /usr/bin/vhclient -t "AUTO USE CLEAR ALL"
# bashio::log.info "STOP USING ALL LOCAL"
# /usr/bin/vhclient -t "STOP USING ALL LOCAL"
#fi
#if bashio::config.has_value 'clientid'; then
# clientid=($(bashio::config 'clientid'))
@@ -28,8 +28,8 @@ fi
# /usr/bin/vh_edit_config General ClientId ${clientid}
#fi
if bashio::config.has_value 'manualhub'; then
manualhub=($(bashio::config 'manualhub'))
bashio::log.info "MANUAL HUB ADD,${manualhub}"
/usr/bin/vhclient -t "MANUAL HUB ADD,${manualhub}"
fi
#if bashio::config.has_value 'manualhub'; then
# manualhub=($(bashio::config 'manualhub'))
# bashio::log.info "MANUAL HUB ADD,${manualhub}"
# /usr/bin/vhclient -t "MANUAL HUB ADD,${manualhub}"
#fi

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

View File

@@ -13,4 +13,4 @@ configuration:
description: Specify server to connect to
usbdevices:
name: USB devices
description: Auto populated from server info, manually update use to true
description: Auto populated from server list, manually update use to true