mirror of
https://github.com/GNS3/gns3-server.git
synced 2025-01-18 23:43:48 +02:00
Wait that an user press a key to stop gns3vmnet.exe on Windows.
This commit is contained in:
parent
e374e52745
commit
5136083853
@ -157,11 +157,13 @@ def vmnet_windows(args, vmnet_range_start, vmnet_range_end):
|
|||||||
for vmnet_number in range(1, 20):
|
for vmnet_number in range(1, 20):
|
||||||
if vmnet_number in (1, 8):
|
if vmnet_number in (1, 8):
|
||||||
continue
|
continue
|
||||||
|
print("Removing vmnet{}...".format(vmnet_number))
|
||||||
os.system('"{}" -- remove adapter vmnet{}'.format(vnetlib_path, vmnet_number))
|
os.system('"{}" -- remove adapter vmnet{}'.format(vnetlib_path, vmnet_number))
|
||||||
else:
|
else:
|
||||||
for vmnet_number in range(vmnet_range_start, vmnet_range_end + 1):
|
for vmnet_number in range(vmnet_range_start, vmnet_range_end + 1):
|
||||||
if vmnet_number in (1, 8):
|
if vmnet_number in (1, 8):
|
||||||
continue
|
continue
|
||||||
|
print("Adding vmnet{}...".format(vmnet_number))
|
||||||
os.system('"{}" -- add adapter vmnet{}'.format(vnetlib_path, 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
|
vmnet_range = args.range if args.range is not None else DEFAULT_RANGE
|
||||||
if sys.platform.startswith("win"):
|
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:
|
else:
|
||||||
vmnet_unix(args, vmnet_range[0], vmnet_range[1])
|
vmnet_unix(args, vmnet_range[0], vmnet_range[1])
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user