From 2825546667e106a9cb30ffb3ed742992a75f5e40 Mon Sep 17 00:00:00 2001 From: crowetic Date: Fri, 18 Oct 2024 19:33:10 -0700 Subject: [PATCH] made various improvements to the gateway setup script... --- qortal-gateway-node-setup.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/qortal-gateway-node-setup.sh b/qortal-gateway-node-setup.sh index 5f8df5e..25ec518 100644 --- a/qortal-gateway-node-setup.sh +++ b/qortal-gateway-node-setup.sh @@ -65,6 +65,12 @@ EOF } configure_qortal_settings() { + # Check if Qortal core is running + QORTAL_RUNNING=false + if curl -s localhost:12391/admin/status > /dev/null; then + QORTAL_RUNNING=true + echo "Qortal core is currently running. It will be restarted after settings modification." + fi # Modify settings.json in ~/qortal directory SETTINGS_PATH="$HOME/qortal/settings.json" if [[ -f $SETTINGS_PATH ]]; then @@ -107,7 +113,13 @@ configure_qortal_settings() { } EOF -# No need to move settings.json, it is already being created in the correct path +# Restart Qortal core if it was running before settings modification + if [[ $QORTAL_RUNNING == true ]]; then + echo "Restarting Qortal core...Please wait...will take ~30 seconds..." + cd ~/qortal + ./stop.sh && sleep 25 && ./start.sh + cd + fi } setup_cron() {