I have this following snippet of code which will when I connect to work, I can run this one script and it will load everything I need. Apologies if I have missed something obvious I was working on their last night while doing a power down at work 🙂
It will work on the first argument and connect to the site, but then if I run it again it won’t disconnect it tells me I am already connected.
Thanks in advance
import subprocess
import sys
import os
if 'c' or 'C' in sys.argv[1]:
subprocess.Popen(["C:\\Program Files\\Checkpoint\\Endpoint Connect\\trac.exe connect -u username -p password"])
elif 'd' or 'D' in sys.argv[1]:
subprocess.Popen(("C:\\Program Files\\Checkpoint\\Endpoint Connect\\trac.exe disconnect "))
when you run it second time, sys.argv[1] = ‘disconnect’, so there’s letter ‘c’ inside. you’d better use:
or