From 96f7fa6528866656a19b46f13899618fc3b1414d Mon Sep 17 00:00:00 2001 From: nnyyxxxx Date: Fri, 8 Nov 2024 02:25:35 -0500 Subject: [PATCH] disregard escalation tool variable if found as root --- core/tabs/common-script.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/core/tabs/common-script.sh b/core/tabs/common-script.sh index f8188ac3..1584d3c7 100644 --- a/core/tabs/common-script.sh +++ b/core/tabs/common-script.sh @@ -84,7 +84,13 @@ checkAURHelper() { } checkEscalationTool() { - ## Check for escalation tools. + if [ "$(id -u)" = "0" ]; then + ESCALATION_TOOL="eval" + ESCALATION_TOOL_CHECKED=true + printf "%b\n" "${CYAN}Running as root, no escalation needed${RC}" + return 0 + fi + if [ -z "$ESCALATION_TOOL_CHECKED" ]; then ESCALATION_TOOLS='sudo doas' for tool in ${ESCALATION_TOOLS}; do