Last active
May 2, 2018 06:03
-
-
Save mscharl/84ad3524bae0242c275cfa37ab4b6ab2 to your computer and use it in GitHub Desktop.
Script to fetch the external ip and write it to a file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export IP=$(curl --silent https://httpbin.org/ip 2>&1 | grep -Eo "([0-9]{1,3}.){3}[0-9]{1,3}") | |
export DATE=$(date +"%Y-%m-%d %H:%M") | |
echo "$DATE: $IP" >> ip.log |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment