Skip to content

Instantly share code, notes, and snippets.

@ChatchaiJ
Created November 27, 2015 05:07
Show Gist options
  • Save ChatchaiJ/fc0be01355da9c6d8c1b to your computer and use it in GitHub Desktop.
Save ChatchaiJ/fc0be01355da9c6d8c1b to your computer and use it in GitHub Desktop.
#!/bin/bash
MAILSVR="mailscan.in.psu.ac.th"
R4=`echo "quit" | nc -w 3 -4 $MAILSVR 25`
R6=`echo "quit" | nc -w 3 -6 $MAILSVR 25`
D=`date '+%Y%m%d %H:%M'`
echo -n "$D "
[ "$R4" ] && echo -n "[IPv4:OK]"
[ "$R6" ] && echo -n "[IPv6:OK]"
echo ""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment