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,9 +171,11 @@ for net in netw: ...@@ -169,9 +171,11 @@ 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
netind={}
for net in nets.keys():
netconf="" netconf=""
sig=nets[net]['Signal Level'] sig=nets[net]['Signal Level']
qual=nets[net]['Quality'] qual=nets[net]['Quality']
...@@ -180,13 +184,21 @@ for net in nets.keys(): ...@@ -180,13 +184,21 @@ for net in nets.keys():
enc=nets[net]['Encryption'] enc=nets[net]['Encryption']
freq=nets[net]['Frequency'] freq=nets[net]['Frequency']
nconf = read_netconf(net) nconf = read_netconf(net)
if nconf: if nconf['saved']:
nauto = 'NO' nauto = 'NO'
if nconf['auto']: if nconf['auto']:
nauto = 'YES' nauto = 'YES'
netconf="AUTO: "+nauto+", PRIO: "+str(nconf['prio']) netconf="AUTO: "+nauto+", PRIO: "+str(nconf['prio'])
print(" "+str(i)+": "+colors.BLUE+net+colors.ENDC+" ("+sigcol(qual)+"sig: "+sig+", qual: "+qual+", freq: "+freq+", enc: "+enc+colors.ENDC+") "+netconf) 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 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