From d06f446fd55f3527702625c159daf16cc2012101 Mon Sep 17 00:00:00 2001 From: Asif Bacchus Date: Wed, 5 Sep 2018 17:20:38 -0600 Subject: [PATCH] Commented in-script elevation, activated explicit root check --- root/scripts/borgbackup.sh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/root/scripts/borgbackup.sh b/root/scripts/borgbackup.sh index a996173..6eb5097 100755 --- a/root/scripts/borgbackup.sh +++ b/root/scripts/borgbackup.sh @@ -103,19 +103,19 @@ logFile=/var/log/borgbackup.log ## Ensure script is running as root (required) otherwise, exit -#if [ $(id -u) -ne 0 ]; then -# echo -e "\e[1;31m[`date +%Y-%m-%d` `date +%H:%M:%S`] This script MUST" \ -# "be run as ROOT." -# echo -e "\e[4;31mScript aborted\e[0;31m.\e[0m" -# exit 1 -#fi +if [ $(id -u) -ne 0 ]; then + echo -e "\e[1;31m[`date +%Y-%m-%d` `date +%H:%M:%S`] This script MUST" \ + "be run as ROOT." + echo -e "\e[4;31mScript aborted\e[0;31m.\e[0m" + exit 1 +fi ### elevate script -- used during program testing -if [ $EUID != 0 ]; then - sudo "$0" "$scriptPath" - exit $? -fi +#if [ $EUID != 0 ]; then +# sudo "$0" "$scriptPath" +# exit $? +#fi ## Write script execution start in log file