Only print requires root messages if effective user id is not root

This commit is contained in:
Dylan Taylor 2021-06-09 23:37:35 -04:00
parent 3909333ae3
commit a8dda07169
1 changed files with 2 additions and 1 deletions

View File

@ -32,7 +32,8 @@ def check_mirror_reachable():
if (exit_code := SysCommand("pacman -Sy").exit_code) == 0:
return True
elif exit_code == 256:
log("check_mirror_reachable() uses 'pacman -Sy' which requires root.", level=logging.ERROR, fg="red")
if os.geteuid() != 0:
log("check_mirror_reachable() uses 'pacman -Sy' which requires root.", level=logging.ERROR, fg="red")
return False