1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-11-28 11:18:11 +00:00

Wait that an user press a key to stop gns3vmnet.exe on Windows.

This commit is contained in:
grossmj 2015-09-16 05:26:17 -06:00
parent e374e52745
commit 5136083853

View File

@ -157,11 +157,13 @@ def vmnet_windows(args, vmnet_range_start, vmnet_range_end):
for vmnet_number in range(1, 20):
if vmnet_number in (1, 8):
continue
print("Removing vmnet{}...".format(vmnet_number))
os.system('"{}" -- remove adapter vmnet{}'.format(vnetlib_path, vmnet_number))
else:
for vmnet_number in range(vmnet_range_start, vmnet_range_end + 1):
if vmnet_number in (1, 8):
continue
print("Adding vmnet{}...".format(vmnet_number))
os.system('"{}" -- add adapter vmnet{}'.format(vnetlib_path, vmnet_number))
@ -232,7 +234,11 @@ def main():
vmnet_range = args.range if args.range is not None else DEFAULT_RANGE
if sys.platform.startswith("win"):
vmnet_windows(args, vmnet_range[0], vmnet_range[1])
try:
vmnet_windows(args, vmnet_range[0], vmnet_range[1])
except SystemExit:
os.system("pause")
raise
else:
vmnet_unix(args, vmnet_range[0], vmnet_range[1])