From b0ba2cf91f3a75ca32304201131571ad87c5cc90 Mon Sep 17 00:00:00 2001 From: davidovski Date: Sun, 2 Jan 2022 23:28:16 +0000 Subject: reverted root check for postinstall scripts --- src/util.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/util.py') diff --git a/src/util.py b/src/util.py index c84d7a3..82fee8c 100644 --- a/src/util.py +++ b/src/util.py @@ -23,6 +23,10 @@ def add_path(*argv): a = a + ("" if a[-1] == "/" else "/") + (b[1:] if b[0] == "/" else b) return a +def is_root(): + return os.environ.get("SUDO_UID") or os.geteuid() == 0 + + def loading_bar(completed, total, text, unit="", color=DEFAULT_BAR_COLOR, reset=DEFAULT_BAR_COLOR_RESET): -- cgit v1.2.1