Guest User

Untitled

a guest
Nov 14th, 2018
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. netcat -z localhost 8287
  2. if [ $? -ne 0 ]; then
  3. echo " Connection refused" |/usr/lib/sendmail -s "Port doesn't function " mit@gmail.com
  4. else
  5. echo "open"
  6. fi
  7.  
  8. if ! nc -z $host $port; then
  9. echo "This message intentionally left blank" | mail -s "TCP port $port is not open on $host" $emailaddress
  10. else
  11. : Do whatever you wanted to do
  12. fi
  13.  
  14. /usr/lib/sendmail -oi -t << EOF
  15. Subject: Port doesn't function
  16. To: mit@gmail.com
  17.  
  18. Connection refused
  19. EOF
  20.  
  21. echo Connection refused | mailx -s "Port doesn't function" mit@gmail.com
Add Comment
Please, Sign In to add comment