50
#!/usr/bin/env bash
CMD="/usr/bin/php hexbear.php"
CHECK_INTERVAL=5
start_process() {
echo "Starting process: $CMD"
$CMD &
PID=$!
echo "Process started with PID $PID"
}
start_process
while true; do
if ! kill -0 "$PID" 2>/dev/null; then
echo "Process crashed or exited. Restarting..."
start_process
fi
sleep "$CHECK_INTERVAL"
done
FIXED IT
