New services, cleanup, readme
This commit is contained in:
21
hass/wait-for-db.sh
Normal file
21
hass/wait-for-db.sh
Normal file
@@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
# wait-for-db.sh
|
||||
|
||||
set -e
|
||||
|
||||
host=${WAITDB_HOST}
|
||||
user=${WAITDB_USER}
|
||||
pass=${WAITDB_PASS}
|
||||
|
||||
echo "$host $user $pass"
|
||||
|
||||
if [[ -v host ]]; then
|
||||
until mysql --host="$host" --user="$user" --password="$pass" -e '\q'; do
|
||||
>&2 echo "Database unavailable - sleeping"
|
||||
sleep 1
|
||||
done
|
||||
>&2 echo "Database available!"
|
||||
fi
|
||||
|
||||
>&2 echo "Executing command"
|
||||
exec "$@"
|
||||
Reference in New Issue
Block a user