edited restart script to use screen if it is installed, or not if not
This commit is contained in:
parent
1611dfd26f
commit
4775dde9cb
@ -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" &
|
||||
|
Loading…
x
Reference in New Issue
Block a user