Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Get outside IPv4 address and echo a line for adding to some poor mans database for later analyzation.
#!/bin/sh
UTCNOW=$(date -u +%s)
CURRENTIP=$(wget -q -O - checkip.dyndns.com | sed -e 's/^.*<body>\(.*\)<\/body>.*$/\1/' | cut -f2 -d: | tr -d [:space:])
echo "${UTCNOW},${CURRENTIP}"
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment