Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- FORCE SHUT OFF VNC BY RYANP
- -- Paste this whole code into AppleScript Editor (type AppleScript editor into your Mac's search bar) and click Run. Let it run for as long as your computer is running.
- repeat
- delay 0.25
- repeat 10000 times
- set portcheck to (do shell script "netstat -n | grep 3283; exit 0")
- if portcheck is not "" then
- set app_name to "ARDAgent"
- set the_pid to (do shell script "ps ax | grep " & (app_name) & " | grep -v grep | awk '{print $1}'")
- try
- if the_pid is not "" then do shell script ("kill -9 " & the_pid)
- end try
- else
- exit repeat
- end if
- end repeat
- end repeat
Add Comment
Please, Sign In to add comment