test
This commit is contained in:
@@ -22,13 +22,14 @@ options=$(bashio::addon.options)
|
||||
#mapfile -t devices < <(/usr/bin/vhclient -t LIST)
|
||||
mapfile -t devices < <(/usr/bin/vh_list_devices)
|
||||
for device in "${devices[@]}"; do
|
||||
if [[ ! " ${options[*]} " =~ [[:space:]]${device}[[:space:]] ]]; then
|
||||
if [[ ! " ${options.usbdevices[*]} " =~ [[:space:]]${device}[[:space:]] ]]; then
|
||||
|
||||
bashio::log.info "Adding to config: ${device}"
|
||||
|
||||
new_options=$(echo $options | jq -n --arg device "$device" '.usbdevices |= . + [{ device: ($device), use: false }]')
|
||||
bashio::log.info "New options: ${new_options}"
|
||||
payload=$(bashio::var.json options "^${new_options}")
|
||||
bashio::log.info "Payload: ${payload}"
|
||||
bashio::api.supervisor POST "/addons/self/options" "${payload}"
|
||||
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user