#!/bin/sh

/sbin/ip route add <%= @destination %> via <%= @via %>

#!/bin/sh

if ! /sbin/ip ro sh | grep -v -q '${destination} via ${via}'
then
  /sbin/ip route add <%= @destination %> via <%= @via %>
fi

Add route only if needed
Add route only if needed
