I created a new batquagga version (0.2) that does exactly that and even when removing the "sleep" and "kill" commands from restore_defaults(), it works fine.
Unfortunately, it does not cover all the cases. I attached the test shell script I used. Without the sleep & kill it does not die ...
The arguments patch or some other form of passing arguments is essential for using the policy-routing-script to redistribute routes from other protocols...
As I said: Your idea is excellent - we just looked for an easy way to find a suitable solution for all sort of cases. The latest revision (1066) contains a method to forward the given arguments. You can use it like this:
batmand --policy-routing-script "test.sh one two three" eth0:bat
or even
batmand --policy-routing-script "test.sh "one two three"" eth0:bat
Greetings, Marek