Commit 3a987222 authored by root's avatar root

Fucking colors!

parent 97f46205
......@@ -15,6 +15,29 @@ except:
boot=False
auto=False
class colors:
RED = '\033[31m'
ENDC = '\033[m'
GREEN = '\033[32m'
YELLOW = '\033[33m'
BLUE = '\033[34m'
CYAN = '\033[36m'
def sigcol(qual):
sigcol={
45: colors.YELLOW,
60: colors.ENDC,
70: colors.GREEN
}
rcol=colors.RED
for col in sigcol.keys():
if int(qual) >= col:
rcol = sigcol[col]
return rcol
def kill_proc(name, ops=False):
for process in psutil.process_iter():
......@@ -64,11 +87,11 @@ def checkYN(res, default='N'):
return True
elif res.lower()=='n' or res.lower()=='fuck no!':
return False
print('WHAT? "'+res+'"? WHAT THE FUCK? I take it as a fuck no!')
print(colors.RED+'WHAT? "'+res+'"? WHAT THE FUCK? I take it as a fuck no!'+colors.ENDC)
return False
if not interface in detect_ifaces():
print("OH FUCK! Interface "+interface+" doesn't exists. Exiting...")
print(colors.RED+"OH FUCK! Interface "+interface+" doesn't exists. Exiting..."+colors.ENDC)
sys.exit(1)
......@@ -102,8 +125,29 @@ else:
print("fucking wpa_supplicant for "+interface+" already fucked but still down, refucking it")
start_wpa(interface)
# detect all networks...
#netw = iw_parse.get_interfaces(interface="wlan0")
#pprint(netw)
netw = iw_parse.get_interfaces(interface="wlan0")
i=1
nets={}
for net in netw:
if 'Mode' in net.keys() and net['Mode'] == 'Master':
if 'Name' in net.keys() and net['Name']:
nets[net['Name']] = net
else:
name='NoEssid_'+str(i)
i=i+1
nets[name] = net
print('Here it is your fucking networks...:')
i=0
for net in nets.keys():
sig=nets[net]['Signal Level']
qual=nets[net]['Quality']
enc='Open'
if 'Encryption' in nets[net].keys():
enc=nets[net]['Encryption']
freq=nets[net]['Frequency']
print(" "+str(i)+": "+colors.BLUE+net+colors.ENDC+" ("+sigcol(qual)+"sig: "+sig+", qual: "+nets[net]['Quality']+", freq: "+freq+", enc: "+enc+colors.ENDC+")")
i=i+1
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