Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # I run this from cron to be an independent "am I online or not", piping output to /tmp/netup
- ext_ip=$(wget -q -O - checkip.dyndns.org | sed -e 's/[^[:digit:]|.]//g')
- len_ext_ip=${#ext_ip}
- #echo "$len_ext_ip"
- if [ $len_ext_ip -gt 16 ]; then
- echo "0.0.0.0"
- else
- echo "$ext_ip"
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement