Restart my WAN interface if mwan3 detects is as offline

As the question my self i have 2 isp wan & wanb

well the primary connection is wan and i have a fail over setup

the thing is sometimes the IP from my wan suddenly getting invalid(no time interval, sometimes a few hours sometimes 2~3 days) and i have to restart the interface in order to get another IP,

Since mwan3 can detect an offline connection base on tracking ip, how do i do it.

i have tried watchcat but im on 19.07 so my watchcat is outdated ( only 1-7 version is available) so 'restart_iface' is not available for me



Insert the following into /etc/mwan3.user

if [ "${ACTION}" = "ifdown" ] && [ "${INTERFACE}" = "wan" ] ; then
   ifup wan

thanks i will try this one

i think this restarts the whole modem

Đ¢his restarts the interface with a logical name "wan".