You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
240 B
16 lines
240 B
#!/bin/bash
|
|
|
|
hostport="$1"
|
|
shift
|
|
cmd="$@"
|
|
|
|
host="${hostport%%:*}"
|
|
port="${hostport##*:}"
|
|
|
|
while ! nc -z "$host" "$port"; do
|
|
echo "Waiting for $host:$port..."
|
|
sleep 1
|
|
done
|
|
|
|
echo "$host:$port is available. Running command: $cmd"
|
|
exec $cmd
|