Can anyone tell me how I get the gateway ip on the status page as a variable ?

I want to put it in the post boot as default route.
Now it is entered as static IP but now and then my provider changes it to irrate me I guess