Change gateway distance if RFC1918 address assigned

Hi,

Currently I am having 2 ISP connected to my Mikrotik using PPPoE. The problem is if one of the PPPoE is getting barred (for not paying the subs reason), so the ISP will assign the address to RFC1918 which are 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16. So how can I make a script to check if the address assigned on the PPPoE interface within the RFC1918 and automatically change the route distance so the default gateway also will change to another ISP that do not have the RFC1918 address pool. Thanks.

P/S: I am not experienced in scripting and programming.

Isn’t it better to pay instead?

Not helping. We have a lot of PPPoE accounts and sometimes we just missed some of them. If you don't want to help, don't reply please.

Simplest solution is pay the bill so it doesn’t suspend. Many of us here being ISP operators probably aren’t super keen to help you circumvent ISP suspensions.

Having said that - you could use a netwatch command to change default gateways - not really scripting just run CLI commands on up/down.