Skip to content
Snippets Groups Projects
Commit d31e5928 authored by Bob Mottram's avatar Bob Mottram
Browse files

Notify when ip address changes

parent 7398f554
No related branches found
No related tags found
No related merge requests found
...@@ -2600,6 +2600,9 @@ function update_dynamic_dns { ...@@ -2600,6 +2600,9 @@ function update_dynamic_dns {
function webadmin_monitor_ip_changes { function webadmin_monitor_ip_changes {
curr_ipv4=$(get_external_ipv4_address) curr_ipv4=$(get_external_ipv4_address)
if [[ "$curr_ipv4" != "$webadmin_ipv4_address" ]]; then if [[ "$curr_ipv4" != "$webadmin_ipv4_address" ]]; then
if [ "$webadmin_ipv4_address" ]; then
/usr/local/bin/${PROJECT_NAME}-notification -s "[${PROJECT_NAME}] Dynamic DNS" -m "IP address changed from $webadmin_ipv4_address to $curr_ipv4"
fi
webadmin_ipv4_address="$curr_ipv4" webadmin_ipv4_address="$curr_ipv4"
update_dynamic_dns update_dynamic_dns
fi fi
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment