🚑 Fixes net.wait_for to be compatible with Busybox 1.30+

This commit is contained in:
Franck Nijhof 2019-06-20 23:44:07 +02:00
parent fd4d77bef2
commit ebb9ece766
No known key found for this signature in database
GPG key ID: D62583BA8AB11CA3

View file

@ -20,12 +20,10 @@ bashio::net.wait_for() {
local host=${2:-'localhost'}
local timeout=${3:-60}
local timeout_argument=""
local timeout_path
bashio::log.trace "${FUNCNAME[0]}" "$@"
timeout_path=$(command -v timeout)
if [[ "$(realpath "${timeout_path}")" =~ "busybox" ]]; then
if timeout -t 1337 true > /dev/null 2>&1; then
timeout_argument="-t"
fi