Add platform check (must be Linux).
This commit is contained in:
parent
94cb159a49
commit
1635c68ade
@ -3,6 +3,7 @@
|
||||
import sys
|
||||
from config import CONFIG_FILE, load_config, save_config
|
||||
from utils import (
|
||||
check_platform,
|
||||
check_root,
|
||||
check_packages,
|
||||
get_keyboard_device_files,
|
||||
@ -113,8 +114,9 @@ def detect_keyloggers():
|
||||
# 1. Setup and initialization
|
||||
############################
|
||||
debug(True, str(sys.argv)) # Set manually to debug if args are being read
|
||||
check_platform()
|
||||
|
||||
global auto_kill_option, verbose_option, safe_option
|
||||
global CONFIG_FILE
|
||||
set_input_options()
|
||||
if verbose_option:
|
||||
print('[Verbose] Input options set')
|
||||
|
||||
14
src/utils.py
14
src/utils.py
@ -3,6 +3,20 @@ import subprocess # for executing shell commands
|
||||
import signal # for sending signals to processes
|
||||
import sys # for exit
|
||||
|
||||
|
||||
|
||||
|
||||
def check_platform():
|
||||
"""
|
||||
Check if platform is Linux.
|
||||
|
||||
Raises:
|
||||
SystemExit: If the platform isn not LInux.
|
||||
"""
|
||||
if sys.platform != 'linux':
|
||||
print("[-] This script only works on Linux.")
|
||||
|
||||
|
||||
def check_root():
|
||||
"""
|
||||
Check if script is run as root(sudo).
|
||||
|
||||
Reference in New Issue
Block a user