blimpstodon/run-services.sh
2024-10-09 18:05:31 -05:00

21 lines
355 B
Bash
Executable file

#!/usr/bin/env bash
set -e
if ! pg_ctl -D ./postgres/16 status; then
pg_ctl -D ./postgres/16 -l ./postgres/postgresql.log start
fi
redis-server > ./redis/redis.log 2> ./redis/redis.err &
echo
echo "Launched postgres and redis"
echo "Hit [enter] to stop services"
read -e
for pid in $(jobs -p); do
kill -9 $pid
done
pg_ctl -D ./postgres/16 stop