misskey/start.sh
Your Name 7708751f36 fix
2023-05-13 15:46:14 -06:00

35 lines
594 B
Bash

#!/bin/bash
SHELL="/bin/bash"
MISSKEY='/opt/misskey'
FILE='/configured.txt'
postgres-check() {
POSTGRES_CHECK=$(ps aux | grep -i logical | head -1)
if [[ "$POSTGRES_CHECK" = *"replication"* ]]; then
echo "Postgres is running!"
else
echo "Postgres is not in Running yet!"
sleep 2
postgres-check
fi
}
cd $MISSKEY
redis-server --protected-mode no --daemonize yes
sleep 30
if [ ! -f "$FILE" ]; then
bash /opt/setup.sh
touch /configured.txt
fi
su postgres -s $SHELL -lc "$PG_BIN/pg_ctl start -D $PG_DIR" &
postgres-check
nginx &
NODE_ENV=production npm start
tail -f /dev/null