Update use device on/off
This commit is contained in:
@@ -22,23 +22,39 @@ if bashio::config.has_value 'usbdevices'; then
|
|||||||
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%.*})
|
#server_serial=$(/usr/bin/vh_server_serial_number ${deviceid%.*})
|
||||||
device2=$(/usr/bin/vh_usb_product_vendor $deviceid)
|
#device2=$(/usr/bin/vh_usb_product_vendor $deviceid)
|
||||||
deviceid2="${server_serial}.${device2}"
|
#deviceid2="${server_serial}.${device2}"
|
||||||
bashio::log.info "GURKA-${inuse_devices}"
|
#bashio::log.info "GURKA-${inuse_devices}"
|
||||||
|
|
||||||
if $use; then
|
if [[ "${inuse_devices[@]}" =~ "$device" ]]; then
|
||||||
#bashio::log.info "AUTO USE DEVICE,${deviceid}"
|
if $use; then
|
||||||
#/usr/bin/vhclient -t "AUTO USE DEVICE,${deviceid}"
|
bashio::log.info "AUTO USE DEVICE,${deviceid} - already in use"
|
||||||
bashio::log.info "AutoShare ${deviceid2} on"
|
else
|
||||||
/usr/bin/vh_editini AutoShare $deviceid2 1
|
|
||||||
else
|
|
||||||
if [[ "${inuse_devices[@]}" =~ "$device" ]]; then
|
|
||||||
bashio::log.info "STOP USING,${deviceid}"
|
bashio::log.info "STOP USING,${deviceid}"
|
||||||
/usr/bin/vhclient -t "STOP USING,${deviceid}"
|
/usr/bin/vhclient -t "STOP USING,${deviceid}"
|
||||||
#bashio::log.info "AutoShare ${deviceid2} off"
|
fi
|
||||||
#/usr/bin/vh_editini AutoShare $deviceid2 0
|
else
|
||||||
|
if $use; then
|
||||||
|
bashio::log.info "AUTO USE DEVICE,${deviceid}"
|
||||||
|
/usr/bin/vhclient -t "AUTO USE DEVICE,${deviceid}"
|
||||||
|
else
|
||||||
|
bashio::log.info "STOP USING,${deviceid} - not in use"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
#if $use; then
|
||||||
|
#bashio::log.info "AUTO USE DEVICE,${deviceid}"
|
||||||
|
#/usr/bin/vhclient -t "AUTO USE DEVICE,${deviceid}"
|
||||||
|
#bashio::log.info "AutoShare ${deviceid2} on"
|
||||||
|
#/usr/bin/vh_editini AutoShare $deviceid2 1
|
||||||
|
#else
|
||||||
|
#if [[ "${inuse_devices[@]}" =~ "$device" ]]; then
|
||||||
|
#bashio::log.info "STOP USING,${deviceid}"
|
||||||
|
#/usr/bin/vhclient -t "STOP USING,${deviceid}"
|
||||||
|
#bashio::log.info "AutoShare ${deviceid2} off"
|
||||||
|
#/usr/bin/vh_editini AutoShare $deviceid2 0
|
||||||
|
#fi
|
||||||
|
#fi
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user