Starting to fucking manage connection

parent 74cf44b2
...@@ -155,7 +155,8 @@ def show_fuck_list(nets): ...@@ -155,7 +155,8 @@ def show_fuck_list(nets):
if 'Encryption' in nets[net].keys(): if 'Encryption' in nets[net].keys():
enc=nets[net]['Encryption'] enc=nets[net]['Encryption']
freq=nets[net]['Frequency'] freq=nets[net]['Frequency']
nconf = read_netconf(net) nconf = read_netconf(nets[net]['Name'])
#nets[net]['conf']=nconf
if nconf['saved']: if nconf['saved']:
nauto = 'NO' nauto = 'NO'
if nconf['auto']: if nconf['auto']:
...@@ -234,6 +235,7 @@ else: ...@@ -234,6 +235,7 @@ else:
SM="init" SM="init"
EXIT=False EXIT=False
selected=False
while not EXIT: while not EXIT:
...@@ -257,6 +259,8 @@ while not EXIT: ...@@ -257,6 +259,8 @@ while not EXIT:
i=i+1 i=i+1
nets[name] = net nets[name] = net
nets[name]['Name'] == name.replace("/", "").replace("..","") nets[name]['Name'] == name.replace("/", "").replace("..","")
nconf = read_netconf(nets[name]['Name'])
nets[name]['conf'] = nconf
if auto or boot: if auto or boot:
SM="autoselect" SM="autoselect"
else: else:
...@@ -264,10 +268,43 @@ while not EXIT: ...@@ -264,10 +268,43 @@ while not EXIT:
elif SM=="autoselect": elif SM=="autoselect":
print_msg("\n ** FUCK-O-MATIK Mode Selected ** \n") print_msg("\n ** FUCK-O-MATIK Mode Selected ** \n")
sys.exit(0) selected=False
for net in nets.keys():
if nets[net]['conf']['saved']:
if not selected:
selected=nets[net]
else:
if int(selected['conf']['prio']) > int(net['conf']['prio']):
selected=nets[net]
elif int(selected['conf']['prio']) == int(net['conf']['prio']):
if int(selected['Quality']) < int(net['Quality']):
selected=nets[net]
SM="connect"
elif SM=="connect":
done=False
if selected:
done=True
else:
print_error("FUCK, Are you asking me to connect but you didn't select successfully any network???")
if done:
print(colors.BCYAN+"\n Are we fucking connected? Up to you to check, do something for fuck sake! \n"+colors.ENDC)
if boot:
if done:
print("FUCKING WIFI OK! ")
else:
print("Fucking wifi NOT OK!")
sys.exit(0)
if auto:
sys.exit(0)
time.sleep(2)
SM="main"
elif SM=="main": elif SM=="main":
selected = False
netind = {} netind = {}
fuck = "none" fuck = "none"
while fuck not in netind.keys() and fuck.lower() not in ['e', 'r', 'q','s', 'm']: while fuck not in netind.keys() and fuck.lower() not in ['e', 'r', 'q','s', 'm']:
...@@ -284,6 +321,10 @@ while not EXIT: ...@@ -284,6 +321,10 @@ while not EXIT:
time.sleep(1) time.sleep(1)
elif fuck.lower()=='e': elif fuck.lower()=='e':
SM="editor" SM="editor"
elif fuck in netind.keys():
selected=netind[fuck]
SM="connect"
elif SM=="remove": elif SM=="remove":
print("\n FOR FUCK SAKE, are you too lazy to do a rm by hand in "+NETPATH+"?\n") print("\n FOR FUCK SAKE, are you too lazy to do a rm by hand in "+NETPATH+"?\n")
......
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