Improve the update script to use the owner of the git repo

This commit is contained in:
Logan Cusano
2023-08-06 16:49:31 -04:00
parent 556697725a
commit ca2815ab8f

View File

@@ -17,10 +17,12 @@ echo "<!-- UPDATING ---!>"
# 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