Skip to content

Instantly share code, notes, and snippets.

@Stadicus
Last active February 12, 2018 22:55
Show Gist options
  • Save Stadicus/76e7b86976477d8980ef37fc263254c7 to your computer and use it in GitHub Desktop.
Save Stadicus/76e7b86976477d8980ef37fc263254c7 to your computer and use it in GitHub Desktop.
Write public ip address into file every 5 minutes
#!/bin/bash
# getpublicip.sh
echo 'getpublicip.sh started, writing public IP address every 10 minutes into /run/publicip'
while [ 0 ];
do
printf "PUBLICIP=$(curl -vv ipinfo.io/ip 2> /run/publicip.log)\n" > /run/publicip;
sleep 600
done;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment