diff --git a/restart-qortal-every-2-hours.sh b/restart-qortal-every-2-hours.sh index 7fe0c85..3e95853 100644 --- a/restart-qortal-every-2-hours.sh +++ b/restart-qortal-every-2-hours.sh @@ -3,6 +3,15 @@ # Path to the Qortal folder QORTAL_DIR=~/qortal +# Check if screen is installed +if command -v screen &> /dev/null; then + echo "Screen is installed, running script in a screen session..." + screen -S qortal_restart -dm bash -c "$0" + exit 0 +else + echo "Screen is not installed, running script normally..." +fi + while true; do # Navigate to Qortal directory cd "$QORTAL_DIR" || exit @@ -32,7 +41,7 @@ while true; do # Start Qortal core ./start.sh - # Wait for 2 hours while logging output + # Wait for 2 hours while logging output --- CHANGE THE NUMBER OF HOURS HERE. sleep 2h & sleep_pid=$! tail -f "$QORTAL_DIR/qortal.log" &