Hi there
I am in the process of writing a script to check whether a port on a remote system is up or not.
Here's what I have so far:
#!/bin/bash
telnet xx.xx.xx.xx 80 | (echo "^]")
if [[ `echo $?` != 0 ]]; then
echo "Please check Web services " | mailx -s "Please check webservices for frontend" email@work.com
fi
Would this work? I'm not sure if the exit status code would be a reflection of the telnet or the break sequence, if that makes sense?
Your input would be greatly appreciated.