Files
home-assistant-addons/vhclient/rootfs/etc/s6-overlay/s6-rc.d/config/run
Hans Karlinius eeacf5c0a4 test
2024-11-26 17:00:48 +01:00

25 lines
665 B
Plaintext
Executable File

#!/command/with-contenv bashio
if bashio::config.has_value 'autouse'; then
autouse=($(bashio::config 'autouse'))
bashio::log.info "Set AUTOUSE all devices to ${autouse}"
if autouse; then
/usr/bin/vhclient -t "AUTO USE ALL"
else
/usr/bin/vhclient -t "AUTO USE CLEAR ALL"
fi
fi
if bashio::config.has_value 'autofind'; then
autofind=($(bashio::config 'autofind'))
bashio::log.info "Set AUTOFIND hub to ${autofind}"
# TODO: check before toggle
/usr/bin/vhclient -t "AUTOFIND"
fi
if bashio::config.has_value 'hub'; then
hub=($(bashio::config 'hub'))
bashio::log.info "Set HUB to ${hub}"
/usr/bin/vhclient -t "MANUAL HUB ADD,${hub}"
fi