#!/bin/bash
-if hash dig 2>/dev/null; then
- dig +short myip.opendns.com @resolver1.opendns.com
-elif hash curl 2>/dev/null; then
- curl -s ifconfig.me/ip
-fi
+curl -4 -s ip.rmz.io && echo
+ret4=$?
+curl -6 -s ip.rmz.io && echo
+ret6=$?
+
+exit $((ret4 && ret6))