Way to bypass upstream proxy when upstream is dead

I emailed support on this scenario:

MT 2.9.30. Proxy is enabled. Upstream parent proxy is enabled. Works great. However, my upstream proxy dies. The result is that all subsequent access from local lan also dies.

The suggested solution by MT support:

Direct list should help you, direct list rules specifies to pass requests to the parent-proxy or try to resolve them directly. Probably, you can create script (e.g. ‘/tool netwatch’) to monitor parent-proxy address.
If address is not responding, ‘down’ script should be
executed that disables requests passing to the parent proxy
and starts resolving them directly, If address is responding,
‘up’ script should be executed that enable resolving requests via parent proxy. ‘/tool netwatch add host=xxxx down-script=scirpt_name_1 up-script=script_name_2’

I have followed this suggestion and have enabled nettools to monitor proxy parent. I also asked for links on how to create scripts:

Information about RouterOS scripting,
http://www.mikrotik.com/docs/ros/2.9/system/scripting

So i also created (or tried to create) the script:
Proxy_down script:
/ \r
ip proxy \r
direct \r
disable 0 \r


Proxy_up script:
/ \r
ip proxy \r
direct \r
enable 0 \r


(i have created an ip proxy direct rule to allow direct access to 0.0.0.0/0 , so the plan is, if proxy parent is down, we just enable this rule, and if it is up, we disable this rule)…

However, when i click on the run script command, i dont see the proxy access greyed out…which means the script doesnt work…

help?

referencing an item by its number does not work in scripts. So the following won’t work:

/ip firewall mangle disable 0

You should use ‘find’ command instead:

/ip firewall mangle disable [/ip firewall mangle find comment="This rule should be disabled"]

Eugene