mirror of
https://github.com/trushildhokiya/allininx-2.git
synced 2025-03-15 19:18:40 +00:00
12 lines
220 B
Bash
12 lines
220 B
Bash
|
#!/usr/bin/env sh
|
||
|
|
||
|
host="$1"
|
||
|
port="$2"
|
||
|
|
||
|
until echo "SELECT 1;" | nc "$host" "$port" > /dev/null 2>&1; do
|
||
|
>&2 echo "Database is unavailable - Sleeping..."
|
||
|
sleep 2
|
||
|
done
|
||
|
|
||
|
>&2 echo "Database is available! Continuing..."
|