Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # simple wrapper to test and see if you're online so your scripts don't waste your time (or clog your log).
- # I test this way because of hotspots that let you *connect* - but you aren't online.
- cmd="$@"
- ext_ip=$(/usr/bin/wget -q -O - checkip.dyndns.org | /bin/sed -e 's/[^[:digit:]|.]//g')
- len_ext_ip=${#ext_ip}
- if [ $len_ext_ip -lt 16 ]; then
- if [ $len_ext_ip -gt 7 ]; then
- exec $cmd
- fi
- fi
- #echo "$cmd"
- #echo "$ext_ip"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement