-
-
Save fmoledina/8f1afc2c117ff857e58d44d172fd6fc7 to your computer and use it in GitHub Desktop.
Write public ip address into file every hour
This file contains hidden or 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
#!/bin/bash | |
# getpubip.sh, use with systemd service and hourly timer | |
PUBIPADDR=$(curl v4.ifconfig.co) | |
echo "PUBIP_V4=$PUBIPADDR" > /etc/pubip/pubip | |
PUBIPADDR6=$(curl v6.ifconfig.co) | |
echo "PUBIP_V6=$PUBIPADDR6" | tee -a /etc/pubip/pubip |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment