updated start again
This commit is contained in:
parent
0b8fd6b332
commit
0803b94234
@ -1,8 +1,14 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Define color codes for output
|
||||||
|
RED='\033[0;31m'
|
||||||
|
NC='\033[0m' # No color
|
||||||
|
|
||||||
|
|
||||||
# Check if Qortal is running
|
# Check if Qortal is running
|
||||||
QORTAL_RUNNING=$(pgrep -f 'java.*qortal' > /dev/null && echo 1 || echo 0)
|
QORTAL_RUNNING=$(pgrep -f 'java.*qortal' > /dev/null && echo 1 || echo 0)
|
||||||
GUI_START="${HOME}/.config/autostart/start-qortal.desktop"
|
GUI_START="${HOME}/.config/autostart/start-qortal.desktop"
|
||||||
|
QORTAL_LOG="${HOME}/qortal/qortal.log"
|
||||||
|
|
||||||
if [[ -f "$GUI_START" ]]; then
|
if [[ -f "$GUI_START" ]]; then
|
||||||
echo "Qortal is set to start via GUI. Checking if it is running..."
|
echo "Qortal is set to start via GUI. Checking if it is running..."
|
||||||
@ -16,7 +22,12 @@ if [[ -f "$GUI_START" ]]; then
|
|||||||
echo "Qortal is running and responding. Exiting..."
|
echo "Qortal is running and responding. Exiting..."
|
||||||
exit 0
|
exit 0
|
||||||
else
|
else
|
||||||
echo "Qortal is running but not responding. Restarting..."
|
echo "Qortal is running but not responding. Checking for bootstrapping..."
|
||||||
|
if tail -n 5 "$QORTAL_LOG" | grep -Ei 'bootstrap|bootstrapping' > /dev/null; then
|
||||||
|
echo -e "${RED}Node seems to be bootstrapping, assuming it is fine, exiting...${NC}"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
echo "Qortal is not bootstrapping. Restarting..."
|
||||||
killall -9 java
|
killall -9 java
|
||||||
sleep 5
|
sleep 5
|
||||||
fi
|
fi
|
||||||
@ -63,7 +74,12 @@ else
|
|||||||
echo "Qortal is responding. Exiting..."
|
echo "Qortal is responding. Exiting..."
|
||||||
exit 0
|
exit 0
|
||||||
else
|
else
|
||||||
echo "Qortal is running but unresponsive. Restarting..."
|
echo "Qortal is running but unresponsive. Checking for bootstrapping..."
|
||||||
|
if tail -n 5 "$QORTAL_LOG" | grep -Ei 'bootstrap|bootstrapping' > /dev/null; then
|
||||||
|
echo -e "${RED}Node seems to be bootstrapping, assuming it is operational... exiting...${NC}"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
echo "Qortal is not bootstrapping. Restarting..."
|
||||||
killall -9 java
|
killall -9 java
|
||||||
sleep 5
|
sleep 5
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user