def stopVPNn(n):
# Stop the platform VPN task.
if not fakeConnection():
p = getPlatform()
if p == platforms.LINUX or p == platforms.RPI:
if useBigHammer(): n = "9"
command = "killall -" + n + " openvpn"
if useSudo(): command = "sudo " + command
debugTrace("(Linux) Stopping VPN with " + command)
os.system(command)
if p == platforms.WINDOWS:
# This call doesn't pay any attention to the size of the hammer.
# Probably for Windows, if n is 15, then I should omit the /F but
# I've not noticed any problems using /F so the n is ignored
command = "taskkill /F /T /IM openvpn*"
debugTrace("(Windows) Stopping VPN with " + command)
args = shlex.split(command)
proc = subprocess.Popen(args, creationflags=subprocess.SW_HIDE, shell=True)
# **** ADD MORE PLATFORMS HERE ****
return
评论列表
文章目录