Files
docker-guacamole/root/etc/services.d/guacamole/run
T
2017-09-02 00:09:42 +10:00

18 lines
481 B
Plaintext

#!/usr/bin/with-contenv sh
until pg_isready; do
echo "Waiting for postgres to come up..."
sleep 1
done
# Create database if it does not exist
psql -U postgres -lqt | cut -d \| -f 1 | grep -qw $POSTGRES_DB
if [ $? -ne 0 ]; then
createuser -U postgres $POSTGRES_USER
createdb -U postgres -O $POSTGRES_USER $POSTGRES_DB
cat /app/guacamole/schema/*.sql | psql -U $POSTGRES_USER -d $POSTGRES_DB -f -
fi
echo "Starting guacamole client..."
s6-setuidgid root catalina.sh run