From fee7c05d7141664db43990d950073a07c89dc9ca Mon Sep 17 00:00:00 2001 From: sTiKyt Date: Tue, 9 Jun 2020 02:27:20 +0300 Subject: [PATCH] Improved platform detection code --- Defs/ActionManager/simple_informant.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/Defs/ActionManager/simple_informant.py b/Defs/ActionManager/simple_informant.py index 9bbca26..bce00f1 100644 --- a/Defs/ActionManager/simple_informant.py +++ b/Defs/ActionManager/simple_informant.py @@ -194,15 +194,23 @@ def verify_connection(host='https://dark-sec-official.com'): # Connection check 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: 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() def check_php(): try: