sbbs/start.sh
Deon George 25fe513953
All checks were successful
Create Docker Image / Build Docker Image (x86_64) (push) Successful in 6m28s
Create Docker Image / Final Docker Image Manifest (push) Successful in 10s
Fix for startup when running under rosetta
2024-12-23 12:52:52 +11:00

39 lines
713 B
Bash
Executable File

#!/bin/bash
export PIDDIR=${PIDDIR:-/var/run}
export SBBSCTRL=/opt/sbbs/ctrl
PIDFILE=${PIDDIR}/sbbs.pid
# Proxy signals
function kill_app(){
kill $(cat ${PIDFILE})
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
NAME=$(basename $(cat /proc/${SBBS_PID}/cmdline |awk 'BEGIN { FS = "\0" } ;{print $(NF-2)}'))
#echo "* SBBS NAME [${NAME}]"
if [ "${NAME}" != "sbbs" -a "${NAME}" != "/mnt/lima-rosetta/rosetta" ]; then
echo "! Name not matching? [${NAME}]"
break;
fi
sleep 15
done
echo "? SBBS stopped"
else
echo "? NO SBBS PID?"
fi
exit 1