sbbs/start.sh

38 lines
618 B
Bash
Raw Normal View History

#!/bin/bash
export SBBSCTRL=/opt/sbbs/ctrl
2023-05-24 10:19:38 +00:00
PIDFILE=/var/run/sbbs.pid
# Proxy signals
function kill_app(){
kill $(cat ${SBBS_PID})
exit 0 # exit okay
}
trap "kill_app" SIGINT SIGTERM
sbbs -d
sleep 5
SBBS_PID=$(cat ${PIDFILE})
echo "* SBBS PID [${SBBS_PID}]"
if [ -n ${SBBS_PID} ]; then
while [ -d /proc/${SBBS_PID} ]; do
2022-10-17 11:57:20 +00:00
NAME=$(cat /proc/${SBBS_PID}/cmdline |awk 'BEGIN { FS = "\0" } ;{print $1}')
#echo "* SBBS NAME [${NAME}]"
2020-08-02 07:52:09 +00:00
if [ "${NAME}" != "sbbs" ]; then
echo "! Name not matching? [${NAME}]"
break;
fi
sleep 15
done
echo "? SBBS stopped"
else
echo "? NO SBBS PID?"
fi
exit 1