From dcc32bca48ba9dd68d25c69472e8ed5ce00ad8e4 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