I came up with another function for the script. It would be good if the email notification contained an external ip received through the service myip.com or something similar.
Shows not only the IP, but also the domain name.
***WAN Failback Notification***
----------------------------------------------------------------------------------------
Hostname: sinema.asuscomm.com
Event Time: Jul 19 15:21:23
Active ISP:
WAN IPv4 Address: 178.249.55.33
WAN Gateway IP Address: 178.249.55.254
WAN Interface: eth0
DNS: Managed by AdGuardHome
QoS Status: Enabled
QoS Mode: Manual Settings
QoS Download Bandwidth: 100Mbps
QoS Upload Bandwidth: 100Mbps
QoS WAN Packet Overhead: 48
***WAN Load Balancing Notification***
----------------------------------------------------------------------------------------
Hostname:sinema.asuscomm.com
Event Time: Jul 19 20:57:52
WAN0 IPv4 Address: 178.249.55.33
WAN0 Status: DISCONNECTED
WAN1 IPv4 Address: 192.168.199.100
WAN1 Status: CONNECTED