Improved platform detection code

This commit is contained in:
sTiKyt 2020-06-09 02:27:20 +03:00
parent 444ae10e2a
commit fee7c05d71
No known key found for this signature in database
GPG Key ID: 510E1C3C9B2414B4

View File

@ -194,15 +194,23 @@ def verify_connection(host='https://dark-sec-official.com'): # Connection check
def check_permissions(): def check_permissions():
if platform_os() != "Windows": # if platform_os() != "Windows":
# if getuid() == 0:
# print(localization.lang_check_permissions["permissions_granted"])
# else:
# print(localization.lang_check_permissions["permissions_denied"])
# exit()
# else:
# print(localization.lang_check_permissions["windows_warning"])
# exit()
## Everything above will be replaced ##
if check_platform("system") == "Linux":
if getuid() == 0: if getuid() == 0:
print(localization.lang_check_permissions["permissions_granted"]) print(localization.lang_check_permissions["permissions_granted"])
else: else:
print(localization.lang_check_permissions["permissions_denied"]) print(localization.lang_check_permissions["permissions_denied"])
exit() exit()
else:
print(localization.lang_check_permissions["windows_warning"])
exit()
def check_php(): def check_php():
try: try: