Update use device on/off
This commit is contained in:
@@ -8,7 +8,7 @@ fi
|
|||||||
|
|
||||||
autouse=$(bashio::cache.get autouse)
|
autouse=$(bashio::cache.get autouse)
|
||||||
if $autouse; then
|
if $autouse; then
|
||||||
bashio::log.info "AutoShare enabled, will not use devices from configuration"
|
bashio::log.info "AutoShare All enabled, will not use devices from configuration"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -21,6 +21,12 @@ if bashio::config.has_value 'usbdevices'; then
|
|||||||
use=$(echo $usbdevice | jq '. | if .use then true else false end')
|
use=$(echo $usbdevice | jq '. | if .use then true else false end')
|
||||||
device=$(echo $usbdevice | jq '.device | tostring')
|
device=$(echo $usbdevice | jq '.device | tostring')
|
||||||
deviceid=$(echo $device | sed 's/.*(\(.*\)).*/\1/g')
|
deviceid=$(echo $device | sed 's/.*(\(.*\)).*/\1/g')
|
||||||
|
|
||||||
|
server_serial=$(/usr/bin/vh_server_serial_number ${deviceid%.*})
|
||||||
|
device2=$(/usr/bin/vh_usb_product_vendor $deviceid)
|
||||||
|
deviceid2=$(server_serial.$device2)
|
||||||
|
bashio::log.info "GURKA-${deviceid2}"
|
||||||
|
|
||||||
if $use; then
|
if $use; then
|
||||||
bashio::log.info "AUTO USE DEVICE,${deviceid}"
|
bashio::log.info "AUTO USE DEVICE,${deviceid}"
|
||||||
/usr/bin/vhclient -t "AUTO USE DEVICE,${deviceid}"
|
/usr/bin/vhclient -t "AUTO USE DEVICE,${deviceid}"
|
||||||
|
|||||||
+3
@@ -0,0 +1,3 @@
|
|||||||
|
#!/command/with-contenv bashio
|
||||||
|
|
||||||
|
/usr/bin/vhclient -t "server info,$1" | awk '{ if ($0 ~ /SERIAL NUMBER/) { print $3 } }'
|
||||||
+3
@@ -0,0 +1,3 @@
|
|||||||
|
#!/command/with-contenv bashio
|
||||||
|
|
||||||
|
/usr/bin/vhclient -t "device info,$1" | awk '{ if ($0 ~ /PRODUCT ID/) { p=$3 } if ($0 ~ /VENDOR ID/) { v=$3 } } END { printf("%d.%d",p,v) }'
|
||||||
Reference in New Issue
Block a user