It's fucking working :D

parent 1a3c9514
...@@ -134,6 +134,7 @@ def read_netconf(net): ...@@ -134,6 +134,7 @@ def read_netconf(net):
for line in lines: for line in lines:
if ":" in line: if ":" in line:
k, v = line.split(":", 1) k, v = line.split(":", 1)
v=v.replace("\n", "")
if k in ['auto', 'dhcp']: if k in ['auto', 'dhcp']:
v=checkYN(v) v=checkYN(v)
if k=='gw': if k=='gw':
...@@ -255,7 +256,7 @@ def insertNetwork(net): ...@@ -255,7 +256,7 @@ def insertNetwork(net):
pwd = input("Enter the fucking PASSWORD: ") pwd = input("Enter the fucking PASSWORD: ")
dhcp = checkYN(input("Is this fucking wifi having a DHCP? <Y|n>: "), default='Y') dhcp = checkYN(input("Is this fucking wifi having a DHCP? <Y|n>: "), default='Y')
errnum = 0 errnum = 0
net['conf']['psk'] = pwd net['conf']['psk'] = pwd.replace("\n", "")
net['conf']['dhcp'] = dhcp net['conf']['dhcp'] = dhcp
if not dhcp: if not dhcp:
ip = None ip = None
...@@ -414,10 +415,10 @@ while not EXIT: ...@@ -414,10 +415,10 @@ while not EXIT:
if selected['conf']['dhcp']: if selected['conf']['dhcp']:
sh("dhclient "+interface) sh("dhclient "+interface)
else: else:
sh("ip address add "+selected['conf']['ip']+"/"+netmaskToBit(selected['conf']['nmask'])+" dev "+interface) sh("ip address add "+selected['conf']['ip']+"/"+netmaskToBit(selected['conf']['nmask'])+" dev "+interface+" > /dev/null 2>&1")
sh("ip link set "+interface+" up") sh("ip link set "+interface+" up > /dev/null 2>&1")
if selected['conf']['gw']: if selected['conf']['gw']:
sh("ip route add default via "+selected['conf']['gw']+" dev "+interface) sh("ip route add default via "+selected['conf']['gw']+" dev "+interface+" > /dev/null 2>&1")
done=True done=True
else: else:
print_error("FUCK, Are you asking me to connect but you didn't select successfully any network???") print_error("FUCK, Are you asking me to connect but you didn't select successfully any network???")
......
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