summaryrefslogtreecommitdiff
path: root/src/util.py
diff options
context:
space:
mode:
authordavidovski <david@davidovski.xyz>2022-01-02 23:28:16 +0000
committerdavidovski <david@davidovski.xyz>2022-01-02 23:28:16 +0000
commitb0ba2cf91f3a75ca32304201131571ad87c5cc90 (patch)
treeb79063f7fcc7564286013eb75bf7d2285e1e890b /src/util.py
parent0439ebca59601c28d5739f1cfe4b90ab29b1492c (diff)
reverted root check for postinstall scripts
Diffstat (limited to 'src/util.py')
-rw-r--r--src/util.py4
1 files changed, 4 insertions, 0 deletions
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):