akkoma/postgresql/start.sh

27 lines
462 B
Bash
Raw Normal View History

2022-11-27 15:12:31 -07:00
#!/bin/bash
export SHELL="/bin/bash"
FILE='/configured.txt'
#Set Permissions
chmod -R 777 /saves
#Configure Local Time
cp -f /usr/share/zoneinfo/US/Mountain /etc/localtime
#Windows Hack
dos2unix /postgres.sh
#Start Cron and Postgresql
crond
su postgres -s $SHELL -lc "pg_ctl start -D /var/lib/postgresql/data"
#Restore latest Database if container is new
if [ ! -f "$FILE" ]
then
#bash /restore.sh
bash /setup.sh
touch /configured.txt
fi
tail -f /dev/null