#!/bin/sh
# {{route_type}}
test "${IFACE}" = "{{iface}}" || exit 0
{% for route in routes %}{% if route.name %}# {{route.name}}
{%endif%}route {{route_type}} -net {% if route.ipaddr %}{{route.ipaddr}}{%endif%} {% if route.netmask %}netmask {{route.netmask}}{%endif%} {% if route.gateway %}gateway {{route.gateway}}{%endif%} dev {{iface}}
{% endfor %}

#!/bin/sh
# {{route_type}}
test "${IFACE}" = "{{iface}}" || exit 0
{% for route in routes %}{% if route.name %}# {{route.name}}
{%endif%}ip route {{route_type}} {% if route.ipaddr %}{{route.ipaddr}}{%endif%}{% if route.netmask %}/{{route.netmask}}{%endif%} {% if route.gateway %}via {{route.gateway}}{%endif%} dev {{iface}}
{% endfor %}

Use ip route instead of the deprecated route
Use ip route instead of the deprecated route

route and ifconfig (provided in debian by package net-tools) are deprecated
since 2009. The same functionality is now provided by the ip command
(in the iproute2 package). This commit changes the script that salt
installs in if-up.d to use ip (from iproute2) rather than route (from
net-tools).
