orchestration.clouds/ahoskingit/terraform/get_current_ip.sh
2021-05-21 09:13:50 -04:00

10 lines
295 B
Bash
Executable File

#!/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