orchestration.clouds/ahoskingit/terraform/get_current_ip.sh

10 lines
295 B
Bash
Raw Permalink Normal View History

#!/bin/bash
DATE=`date`
OLD_IP=`cat /home/ahosking/projects/ahoskingit/orchestration.clouds/ahoskingit/terraform/homeip.auto.tfvars`
IP=`curl ifconfig.me`
echo 'home_ip = "'$IP'"' > homeip.auto.tfvars
MESSAGE="'$DATE' - Old IP was: '$OLD_IP' and the new IP is: '$IP'"
#echo $DATE
echo $MESSAGE