diff --git a/update/update.sh b/update/update.sh index 7e2ae0c..b524474 100644 --- a/update/update.sh +++ b/update/update.sh @@ -174,15 +174,23 @@ HOME=$(eval echo ~$HOME_DIR) # Use the home directory in the path NODE_PATH="$HOME/ceremonyclient/node" -EXEC_START="$NODE_PATH/$NODE_BINARY" +EXEC_START="$NODE_PATH/release_autorun.sh" -# Re-Create Ceremonyclient Service -echo "⏳ Re-Creating Ceremonyclient Service" +# Step 6:Create Ceremonyclient Service +echo "⏳ Creating Ceremonyclient Service" sleep 2 # Add a 2-second delay -SERVICE_FILE="/lib/systemd/system/ceremonyclient.service" -if [ ! -f "$SERVICE_FILE" ]; then - echo "📝 Creating new ceremonyclient service file..." - if ! sudo tee "$SERVICE_FILE" > /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 # Start the ceremonyclient service echo "✅ Starting Ceremonyclient Service"