23
23
-d to disconnect''' # Text to display if there is no argument passed or it's an invalid option - 1.2
24
24
25
25
if len (sys .argv ) < 2 : # Check there is at least one option passed to the script - 1.2
26
- print text # If not print the text above - 1.2
26
+ print ( text ) # If not print the text above - 1.2
27
27
sys .exit () # Exit the program - 1.2
28
-
29
- if '-h' in sys .argv or '--h' in sys .argv or '-help' in sys .argv or '--help' in sys .argv : # Help Menu if called
30
- print text # Print the text, stored in the text variable - 1.2
31
- sys .exit (0 ) # Exit the program
28
+
29
+ if '-h' in sys .argv or '--h' in sys .argv or '-help' in sys .argv or '--help' in sys .argv : # Help Menu if called
30
+ print ( text ) # Print the text, stored in the text variable - 1.2
31
+ sys .exit (0 ) # Exit the program
32
32
else :
33
33
if sys .argv [1 ].lower ().startswith ('-c' ): # If the first argument is -c then
34
- passwd = sys .argv [2 ] # Set the variable passwd as the second argument passed, in this case my login password
34
+ passwd = sys .argv [2 ] # Set the variable passwd as the second argument passed, in this case my login password
35
35
subprocess .Popen ((r"c:\Program Files\Checkpoint\Endpoint Connect\trac.exe connect -u username -p " + passwd ))
36
36
subprocess .Popen ((r"c:\geektools\puttycm.exe" ))
37
37
time .sleep (15 ) # Sleep for 15 seconds, so the checkpoint software can connect before opening mstsc
38
38
subprocess .Popen ([remote , conffilename ])
39
39
elif sys .argv [1 ].lower ().startswith ('-d' ): # If the first argument is -d then disconnect my checkpoint session.
40
40
subprocess .Popen ((r"c:\Program Files\Checkpoint\Endpoint Connect\trac.exe disconnect " ))
41
41
else :
42
- print 'Unknown option - ' + text # If any other option is passed, then print Unknown option and the text from above - 1.2
42
+ print ( 'Unknown option - ' + text ) # If any other option is passed, then print Unknown option and the text from above - 1.2
0 commit comments