From ca2815ab8f59a8cc75c989511c271b5ddfe44fcb Mon Sep 17 00:00:00 2001 From: Logan Cusano Date: Sun, 6 Aug 2023 16:49:31 -0400 Subject: [PATCH] Improve the update script to use the owner of the git repo --- Client/update.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Client/update.sh b/Client/update.sh index 7d91a0d..8b96d6f 100644 --- a/Client/update.sh +++ b/Client/update.sh @@ -17,10 +17,12 @@ echo "" # Stop any running service systemctl stop RadioNode -# Update the git Repo -installUser=$(cat ./config/installerName) -sudo su -l $installUser -c 'git fetch -a -p' -sudo su -l $installUser -c 'git pull' +# Get the owner of the current working directory +cwd_owner=$(stat -c '%U' .) + +# Update the git Repo as the owner of the current working directory +sudo su -l $cwd_owner -c 'git fetch' +sudo su -l $cwd_owner -c 'git pull' # Install any new libraries npm i