Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* TOR runner */
- call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
- call 'SysLoadFuncs'
- PARSE UPPER ARG param
- curdir = directory()
- newdir = directory('C:\tcpip\services\TOR\bin')
- PIDFile = 'D:\var\pid\tor.pid'
- SELECT
- WHEN param = 'STOP' THEN
- DO
- param = 'result = '||param||'()'
- interpret param
- END
- OTHERWISE
- result = 'Valid parameters are: START STOP RESTART'
- END
- say result
- call directory curdir
- exit
- STOP: PROCEDURE EXPOSE PIDFile
- IF STREAM(PIDFile, 'C', 'query exists') = PIDFile THEN
- DO
- call stream PIDFile, 'C', 'close'
- '@so kill 'linein(PIDFile)' > nul 2>&1'
- call SysSleep 3
- rc = SysFileDelete(PIDFile)
- res ='TOR stopping result is: '||rc
- END
- ELSE res = 'TOR is not running!'
- return res
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement