From 0fb455d47477415fa34dff711c04abf5e32655db Mon Sep 17 00:00:00 2001 From: Thomas Roeblitz Date: Wed, 13 Nov 2024 21:53:38 +0100 Subject: [PATCH] remove script is not run by root anymore --- EESSI-remove-software.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/EESSI-remove-software.sh b/EESSI-remove-software.sh index c0818db393..582ed61a7f 100755 --- a/EESSI-remove-software.sh +++ b/EESSI-remove-software.sh @@ -101,7 +101,7 @@ fi pr_diff=$(ls [0-9]*.diff | head -1) # if this script is run as root, use PR patch file to determine if software needs to be removed first -if [ $EUID -eq 0 ]; then +if [ $EUID -ne 0 ]; then changed_easystacks_rebuilds=$(cat ${pr_diff} | grep '^+++' | cut -f2 -d' ' | sed 's@^[a-z]/@@g' | grep 'easystacks/.*yml$' | egrep -v 'known-issues|missing' | grep "/rebuilds/") if [ -z ${changed_easystacks_rebuilds} ]; then echo "No software needs to be removed." @@ -141,5 +141,6 @@ if [ $EUID -eq 0 ]; then done fi else - fatal_error "This script can only be run by root!" + # fatal_error "This script can only be run by root!" + fatal_error "This script must not be run by root!" fi