Files
PacCrypt-Webapp/restart.sh
T
2025-05-14 15:31:43 -10:00

18 lines
287 B
Bash

#!/bin/bash
sleep 2
# Save current process PID
PID=$1
# Gracefully stop the current server
kill "$PID"
# Wait until it exits
while kill -0 "$PID" 2>/dev/null; do
sleep 0.5
done
# Restart with the same interpreter and script
export PRODUCTION=true
exec "$2" "$3"