From e43d9c6036fff2d793f61517996551a1f5158503 Mon Sep 17 00:00:00 2001 From: LaMat <65860122+lamat1111@users.noreply.github.com> Date: Fri, 31 May 2024 09:16:29 +0200 Subject: [PATCH] Update update.sh Added fixes to check the service files for changes to WorkingDirectory=$NODE_PATH ExecStart=$EXEC_START and only edit if necessary With now people customizing the service with CPUQUota and GOMAXPROCS, if we delete the service file we destroy user customizations! --- update.sh | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/update.sh b/update.sh index fb9fad6..7052faf 100644 --- a/update.sh +++ b/update.sh @@ -27,8 +27,10 @@ EXEC_START="$NODE_PATH/release_autorun.sh" # Step 3:Re-Create Ceremonyclient Service echo "⏳ Re-Creating Ceremonyclient Service" sleep 2 # Add a 2-second delay -rm /lib/systemd/system/ceremonyclient.service -sudo tee /lib/systemd/system/ceremonyclient.service > /dev/null < /dev/null <&2 + exit 1 + fi +else + echo "🔍 Checking existing ceremonyclient service file..." + # Check if the required lines exist and if they are different + if ! grep -q "WorkingDirectory=$NODE_PATH" "$SERVICE_FILE" || ! grep -q "ExecStart=$EXEC_START" "$SERVICE_FILE"; then + echo "🔄 Updating existing ceremonyclient service file..." + # Replace the existing lines with new values + sudo sed -i "s|WorkingDirectory=.*|WorkingDirectory=$NODE_PATH|" "$SERVICE_FILE" + sudo sed -i "s|ExecStart=.*|ExecStart=$EXEC_START|" "$SERVICE_FILE" + else + echo "✅ No changes needed." + fi +fi # Step 4:Start the ceremonyclient service echo "✅ Starting Ceremonyclient Service" @@ -54,4 +72,4 @@ sudo service ceremonyclient start echo "🎉 Welcome to Quilibrium Ceremonyclient v1.4.18" echo "⏳ Please let it flow node logs at least 5 minutes then you can press CTRL + C to exit the logs." sleep 5 # Add a 5-second delay -sudo journalctl -u ceremonyclient.service -f --no-hostname -o cat \ No newline at end of file +sudo journalctl -u ceremonyclient.service -f --no-hostname -o cat