this post was submitted on 05 Mar 2026
28 points (100.0% liked)

Chapotraphouse

14296 readers
592 users here now

Banned? DM Wmill to appeal.

No anti-nautilism posts. See: Eco-fascism Primer

Slop posts go in c/slop. Don't post low-hanging fruit here.

founded 5 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] red_giant@hexbear.net 2 points 1 day ago
#!/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