From 0ed81f286ec9ef7ad0bb3e6d3b7a33444a668714 Mon Sep 17 00:00:00 2001 From: Ark74 Date: Wed, 15 Apr 2020 00:16:11 -0500 Subject: [PATCH] Add check if root privileges Move check for jm-bm.sh file --- jitsi-updater.sh | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/jitsi-updater.sh b/jitsi-updater.sh index 6f4b954..c2045fc 100644 --- a/jitsi-updater.sh +++ b/jitsi-updater.sh @@ -19,6 +19,16 @@ DOMAIN=$(ls /etc/prosody/conf.d/ | grep -v localhost | awk -F'.cfg' '{print $1}' INT_CONF=/usr/share/jitsi-meet/interface_config.js jibri_packages=$(grep Package /var/lib/apt/lists/download.jitsi.org_*_Packages | sort -u | awk '{print $2}' | paste -s -d ' ') AVATAR="$(grep -r avatar /etc/nginx/sites-*/ 2>/dev/null)" +#Check if user is root +if ! [ $(id -u) = 0 ]; then + echo "You need to be root or have sudo privileges!" + exit 0 +fi +if [ ! -f jm-bm.sh ]; then + echo "Please check that you are running the jitsi updater while being on the project folder" + echo "other wise the updater might have errors or be incomplete. Exiting..." + exit +fi if [ -f $apt_repo/google-chrome.list ]; then google_package=$(grep Package /var/lib/apt/lists/dl.google.com_linux_chrome_deb_dists_stable_main_binary-amd64_Packages | sort -u | cut -d ' ' -f2 | paste -s -d ' ') else @@ -106,11 +116,6 @@ else echo "Please check your repositories, something is not right." exit 1 fi -if [ ! -f jm-bm.sh ]; then - echo "Please check that you are running the jitsi updater while being on the project folder" - echo "other wise the updater might have errors or be incomplete. Exiting..." - exit -fi # Any customization, image, name or link change for any purpose should # be documented here so new updates won't remove those changes. # We divide them on UI changes and branding changes, feel free to adapt