Commit 74d2a784 authored by James Coyle's avatar James Coyle

Fix for user level detection

parent c3b397c1
Pipeline #1259 passed with stages
in 4 seconds
......@@ -97,19 +97,20 @@ def init_register():
def checks():
global FORCE
if storjstatus_common.get_os_type() == "x":
print_error('Unsupported Os type.')
if storjstatus_common.get_os_type() == "linux":
try:
if os.geteuid() != 0:
print_error('Please run this script with root privileges.')
except AttributeError:
pass
print_error('Error checking user access level.')
elif storjstatus_common.get_os_type() == "win":
try:
if ctypes.windll.shell32.IsUserAnAdmin() != 1:
print_error('Please run this script with Administrator privileges.')
except AttributeError:
print_error('Error checking user access level.')
else:
print_error('Unsupported Os type.')
if FORCE == True:
print("Forcing regeneration of config and crontab. Note cron times may change.")
......
__version__ = '0.3.2'
__version__ = '0.3.3'
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment