Advertisement
Guest User

Untitled

a guest
Oct 25th, 2013
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. on run argv
  2.     set appName to "" & item 1 of argv & ""
  3.     set dispMessage to appName & return & return & tab & "  tries to establish an outgoing connection"
  4.     try
  5.         set diagIn to (display dialog dispMessage with title "TCPBlock Alert" buttons {"Whitelist", "Blacklist", "Cancel"} default button 3 with icon file ((path to current user folder) & "bin:TCPBlock.icns" as string))
  6.         set buttName to the button returned of diagIn
  7.         if buttName is equal to "Cancel" then
  8.             return
  9.         else if buttName is equal to "Blacklist" then
  10.             do shell script "echo " & appName & " >> ~/bin/tcpblock_blacklist.log"
  11.         else
  12.             do shell script "/usr/local/bin/tcpblock -a '" & appName & "'" with administrator privileges
  13.             do shell script "/usr/local/bin/tcpblock -c"
  14.         end if
  15.     end try
  16. end run
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement