Commit a0177509 authored by root's avatar root

Fucking cycle

parent 84fc8321
...@@ -73,7 +73,8 @@ def read_netconf(net): ...@@ -73,7 +73,8 @@ def read_netconf(net):
'dhcp': True, 'dhcp': True,
'ip': '192.168.42.42', 'ip': '192.168.42.42',
'nmask': '255.255.255.0', 'nmask': '255.255.255.0',
'gw': '192.168.42.1' 'gw': '192.168.42.1',
'saved': False
} }
if os.path.isfile(p): if os.path.isfile(p):
try: try:
...@@ -85,11 +86,12 @@ def read_netconf(net): ...@@ -85,11 +86,12 @@ def read_netconf(net):
if k in ['auto', 'dhcp']: if k in ['auto', 'dhcp']:
v=checkYN(v) v=checkYN(v)
conf[k] = v conf[k] = v
conf['saved'] = True
return conf return conf
except: except:
pass pass
return False return conf
def kill_proc(name, ops=False): def kill_proc(name, ops=False):
...@@ -169,24 +171,34 @@ for net in netw: ...@@ -169,24 +171,34 @@ for net in netw:
print('Here it is your fucking networks...:') def show_fuck_list(nets):
i=0 print('\nHere it is your fucking networks...:\n')
for net in nets.keys(): i=0
netconf="" netind={}
sig=nets[net]['Signal Level'] for net in nets.keys():
qual=nets[net]['Quality'] netconf=""
enc='Open' sig=nets[net]['Signal Level']
if 'Encryption' in nets[net].keys(): qual=nets[net]['Quality']
enc=nets[net]['Encryption'] enc='Open'
freq=nets[net]['Frequency'] if 'Encryption' in nets[net].keys():
nconf = read_netconf(net) enc=nets[net]['Encryption']
if nconf: freq=nets[net]['Frequency']
nauto = 'NO' nconf = read_netconf(net)
if nconf['auto']: if nconf['saved']:
nauto = 'YES' nauto = 'NO'
netconf="AUTO: "+nauto+", PRIO: "+str(nconf['prio']) if nconf['auto']:
nauto = 'YES'
print(" "+str(i)+": "+colors.BLUE+net+colors.ENDC+" ("+sigcol(qual)+"sig: "+sig+", qual: "+qual+", freq: "+freq+", enc: "+enc+colors.ENDC+") "+netconf) netconf="AUTO: "+nauto+", PRIO: "+str(nconf['prio'])
i=i+1
print(" "+str(i)+": "+colors.BLUE+net+colors.ENDC+" ("+sigcol(qual)+"sig: "+sig+", qual: "+qual+", freq: "+freq+", enc: "+enc+colors.ENDC+") "+netconf)
netind[str(i)] = nets[net]
i=i+1
return netind
netind = {}
fuck = "none"
while fuck not in netind.keys() and fuck.lower() not in ['e', 'R', 'q']:
netind = show_fuck_list(nets)
fuck = input("\n Choose a fucking one by index, or press E for edit, R to remove, Q to shit the hell out: ")
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