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
|
# Path to the Qortal folder
|
||||||
QORTAL_DIR=~/qortal
|
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
|
while true; do
|
||||||
# Navigate to Qortal directory
|
# Navigate to Qortal directory
|
||||||
cd "$QORTAL_DIR" || exit
|
cd "$QORTAL_DIR" || exit
|
||||||
@ -32,7 +41,7 @@ while true; do
|
|||||||
# Start Qortal core
|
# Start Qortal core
|
||||||
./start.sh
|
./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 2h &
|
||||||
sleep_pid=$!
|
sleep_pid=$!
|
||||||
tail -f "$QORTAL_DIR/qortal.log" &
|
tail -f "$QORTAL_DIR/qortal.log" &
|
||||||
|
Loading…
x
Reference in New Issue
Block a user