#!/bin/sh # Brutally simply hook for dhcpcd assuming you only have a single interface with # delegated prefixes, which is the case for most home routers. # This writes out a radvd conf for the interface and prefix in question and # blindly restarts the daemon. write_radvd() { if [ -z "$new_delegated_dhcp6_prefix" ] ; then echo "Cannot continue without delegated prefix" exit 1; fi conf="interface $interface { AdvSendAdvert on;" for prefix in $new_delegated_dhcp6_prefix ; do conf="$conf prefix $prefix { AdvOnLink on; AdvAutonomous on; AdvRouterAddr on; }; " done conf="$conf };" echo "$conf" > /etc/radvd.conf /etc/init.d/radvd restart } case "$reason" in DELEGATED6) write_radvd ;; esac