Edit. With vim.

parent 6b48dae7
...@@ -425,6 +425,7 @@ while not EXIT: ...@@ -425,6 +425,7 @@ 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("..","")
nets[name]['RealName'] = name
nconf = read_netconf(nets[name]['Name']) nconf = read_netconf(nets[name]['Name'])
nets[name]['conf'] = nconf nets[name]['conf'] = nconf
if auto or boot: if auto or boot:
...@@ -537,15 +538,17 @@ while not EXIT: ...@@ -537,15 +538,17 @@ while not EXIT:
if fuck.lower()=='b': if fuck.lower()=='b':
SM="main" SM="main"
elif fuck in netind.keys(): elif fuck in netind.keys():
if os.path.isfile("/".join([NETPATH, netind[fuck]['Name']])): if os.path.isfile("/".join([NETPATH, netind[fuck]['Name']])) and netind[fuck]['Name']!="":
print(colors.RED+"\n Fucking removing "+netind[fuck]['Name']+"...\n"+colors.ENDC) print(colors.RED+"\n Fucking removing "+netind[fuck]['Name']+"...\n"+colors.ENDC)
try: try:
sh("rm -f "+'/'.join([NETPATH, netind[fuck]['Name']])+" > /dev/null 2&1") sh("rm -f "+'/'.join([NETPATH, netind[fuck]['Name']])+" > /dev/null 2>&1")
nets[netind[fuck]['RealName']]['conf'] = read_netconf(netind[fuck]['Name'])
except: except:
print_error("FUCK i can't Fucking removing "+netind[fuck]['Name']+"!!!") print_error("FUCK i can't Fucking removing "+netind[fuck]['Name']+"!!!")
time.sleep(2)
else: else:
print_error("\n Are you serious? you can't remove what isn't there, CUNT!") print_error("\n Are you serious? you can't remove what isn't there, CUNT!")
time.sleep(1) time.sleep(2)
elif SM=="editor": elif SM=="editor":
...@@ -559,6 +562,18 @@ while not EXIT: ...@@ -559,6 +562,18 @@ while not EXIT:
fuckquit(fuck) fuckquit(fuck)
if fuck.lower()=='b': if fuck.lower()=='b':
SM="main" SM="main"
elif fuck in netind.keys():
if os.path.isfile("/".join([NETPATH, netind[fuck]['Name']])) and netind[fuck]['Name']!="":
try:
os.system("vim "+"/".join([NETPATH, netind[fuck]['Name']]))
nets[netind[fuck]['RealName']]['conf'] = read_netconf(netind[fuck]['Name'])
except:
print_error("FUCK i can't Fucking edit "+netind[fuck]['Name']+"!!!")
time.sleep(2)
else:
print_error("\n Are you serious? you can't edit what isn't there, add it first!")
time.sleep(2)
if not auto and not boot: if not auto and not boot:
os.system("clear") os.system("clear")
......
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