contrib: fix pre-script example

The script had expectation errors with option arguments.  And few other
smaller improvements, such as making the iptable change to be single
function instead of two nearly same ones.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>