It's fucking working :D

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