Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- netcat -z localhost 8287
- if [ $? -ne 0 ]; then
- echo " Connection refused" |/usr/lib/sendmail -s "Port doesn't function " mit@gmail.com
- else
- echo "open"
- fi
- if ! nc -z $host $port; then
- echo "This message intentionally left blank" | mail -s "TCP port $port is not open on $host" $emailaddress
- else
- : Do whatever you wanted to do
- fi
- /usr/lib/sendmail -oi -t << EOF
- Subject: Port doesn't function
- To: mit@gmail.com
- Connection refused
- EOF
- echo Connection refused | mailx -s "Port doesn't function" mit@gmail.com
Add Comment
Please, Sign In to add comment