Log the times when external IP address changes

This commit is contained in:
Bob Mottram 2017-09-25 17:21:53 +01:00
parent d29cc73898
commit 496aa4c5dc
1 changed files with 1 additions and 0 deletions

View File

@ -93,6 +93,7 @@ function update_external_ip {
echo 'if [[ "$curr_ip" != "$existing_ip" ]]; then' >> $ip_update_script echo 'if [[ "$curr_ip" != "$existing_ip" ]]; then' >> $ip_update_script
echo " sed -i \"s|EXTERNAL_IPV4_ADDRESS=.*|EXTERNAL_IPV4_ADDRESS=\${curr_ip}|g\" $CONFIGURATION_FILE" >> $ip_update_script echo " sed -i \"s|EXTERNAL_IPV4_ADDRESS=.*|EXTERNAL_IPV4_ADDRESS=\${curr_ip}|g\" $CONFIGURATION_FILE" >> $ip_update_script
echo ' iptables-save > /etc/firewall.conf' >> $ip_update_script echo ' iptables-save > /etc/firewall.conf' >> $ip_update_script
echo " echo \"\$(date)\" >> ~/${PROJECT_NAME}-external-ip-changes.txt" >> $ip_update_script
echo 'fi' >> $ip_update_script echo 'fi' >> $ip_update_script
cron_add_mins 10 $ip_update_script cron_add_mins 10 $ip_update_script