Update use device on/off
This commit is contained in:
@@ -17,6 +17,7 @@ if bashio::config.has_value 'usbdevices'; then
|
||||
usbdevices_json=$(echo $options | jq -c '.usbdevices[]')
|
||||
readarray -t usbdevices < <(echo "$usbdevices_json")
|
||||
mapfile -t inuse_devices < <(/usr/bin/vh_list_inuse_devices)
|
||||
bashio::log.info "Devices in use - ${inuse_devices[@]}"
|
||||
for usbdevice in "${usbdevices[@]}"; do
|
||||
use=$(echo $usbdevice | jq '. | if .use then true else false end')
|
||||
device=$(echo $usbdevice | jq '.device | tostring')
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
#!/command/with-contenv bashio
|
||||
|
||||
result=$(/usr/bin/vhclient -t list | awk '{ if ($1 ~ /\*-->/) { print substr($0, 8, index($0, "(In-use by you)") - 9 ) } }')
|
||||
bashio::log.info "List device in use - ${result}"
|
||||
/usr/bin/vhclient -t list | awk '{ if ($1 ~ /\*-->/) { print substr($0, 8, index($0, "(In-use by you)") - 9 ) } }'
|
||||
|
||||
Reference in New Issue
Block a user