Commit 123c36a7 authored by James Coyle's avatar James Coyle

Merge branch 'james-dev' into 'master'

Fix for user level detection

See merge request !16
parents cd653f86 74d2a784
Pipeline #1260 passed with stages
in 57 minutes and 25 seconds
......@@ -97,20 +97,21 @@ def init_register():
def checks():
global FORCE
if storjstatus_common.get_os_type() == "x":
if storjstatus_common.get_os_type() == "linux":
try:
if os.geteuid() != 0:
print_error('Please run this script with root privileges.')
except AttributeError:
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.')
try:
if os.geteuid() != 0:
print_error('Please run this script with root privileges.')
except AttributeError:
pass
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.')
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