summaryrefslogtreecommitdiff
path: root/src/util.py
diff options
context:
space:
mode:
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):