mirror of
https://github.com/k4m4/kickthemout.git
synced 2024-11-22 21:14:25 +01:00
Root check
This commit is contained in:
parent
dd3b0b2968
commit
09c25bd891
@ -12,6 +12,17 @@ import time, os, sys, logging, math
|
|||||||
from time import sleep
|
from time import sleep
|
||||||
import urllib2 as urllib
|
import urllib2 as urllib
|
||||||
|
|
||||||
|
notRoot = False
|
||||||
|
try:
|
||||||
|
if os.geteuid() != 0:
|
||||||
|
print("\n{0}ERROR: KickThemOut must run as root. Try again with sudo/root:\n\t{1}$ sudo python kickthemout.py{2}\n").format(RED, GREEN, END)
|
||||||
|
notRoot = True
|
||||||
|
except:
|
||||||
|
# User is probably on windows
|
||||||
|
pass
|
||||||
|
if notRoot:
|
||||||
|
raise SystemExit
|
||||||
|
|
||||||
BLUE, RED, WHITE, YELLOW, MAGENTA, GREEN, END = '\33[94m', '\033[91m', '\33[97m', '\33[93m', '\033[1;35m', '\033[1;32m', '\033[0m'
|
BLUE, RED, WHITE, YELLOW, MAGENTA, GREEN, END = '\33[94m', '\033[91m', '\33[97m', '\33[93m', '\033[1;35m', '\033[1;32m', '\033[0m'
|
||||||
logging.getLogger("scapy.runtime").setLevel(logging.ERROR) # Shut up scapy!
|
logging.getLogger("scapy.runtime").setLevel(logging.ERROR) # Shut up scapy!
|
||||||
try:
|
try:
|
||||||
|
Loading…
Reference in New Issue
Block a user