From 49e6758bcd19699ab8ba64f7c4ff92736bd73b47 Mon Sep 17 00:00:00 2001 From: 0xOzgur <29779769+0xOzgur@users.noreply.github.com> Date: Sun, 26 May 2024 14:16:14 +0300 Subject: [PATCH] non root user fix --- install/install_quilibrium_service.sh | 2 +- update.sh | 30 +++++++++++---------------- 2 files changed, 13 insertions(+), 19 deletions(-) diff --git a/install/install_quilibrium_service.sh b/install/install_quilibrium_service.sh index 1f93528..d872c0b 100644 --- a/install/install_quilibrium_service.sh +++ b/install/install_quilibrium_service.sh @@ -14,7 +14,7 @@ echo "⏳Processing..." sleep 2 # Add a 2-second delay apt update apt upgrade -y -apt install sudo -y +apt install sudo -y #for non root Debian OS users apt install git -y # Step 2: Adjust network buffer sizes diff --git a/update.sh b/update.sh index b19b536..73c6795 100644 --- a/update.sh +++ b/update.sh @@ -18,13 +18,19 @@ git checkout release # Get the system architecture ARCH=$(uname -m) -# Determine the ExecStart line based on the architecture +# Get the current user's home directory +HOME_DIR=$(eval echo ~$USER) + +# Use the home directory in the path +PATH="$HOME_DIR/ceremonyclient/node" + +# Step10.1:Determine the ExecStart line based on the architecture if [ "$ARCH" = "x86_64" ]; then - EXEC_START="/root/ceremonyclient/node/node-1.4.18-linux-amd64" + EXEC_START="$PATH/node-1.4.18-linux-amd64" elif [ "$ARCH" = "aarch64" ]; then - EXEC_START="/root/ceremonyclient/node/node-1.4.18-linux-arm64" + EXEC_START="$PATH/node-1.4.18-linux-arm64" elif [ "$ARCH" = "arm64" ]; then - EXEC_START="/root/ceremonyclient/node/node-1.4.18-darwin-arm64" + EXEC_START="$PATH/node-1.4.18-darwin-arm64" else echo "Unsupported architecture: $ARCH" exit 1 @@ -33,21 +39,9 @@ fi # 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 <