#!/bin/sh # replace default route with all routes that are currently available nexthops= for i in $@; do nexthops="$nexthops nexthop via $i" done ip route replace 0.0.0.0/0 $nexthops