#!/bin/sh

if [ -z "$PPP_IFACE" ]
then
        exit
fi

if [ -n "$PPP_REMOTE" ]
then
        ip -6 route append nexthop via "$PPP_REMOTE" dev "$PPP_IFACE"
else
        ip -6 route append nexthop dev "$PPP_IFACE"
fi

if [ -z "$PPP_IPPARAM" ]
then
        exit
fi

ip -6 route flush table "$PPP_IPPARAM"
ip -6 route add default dev "$PPP_IFACE" table "$PPP_IPPARAM"
ip -6 rule flush table "$PPP_IPPARAM"
