#!/bin/sh # Place in /etc/hotplug.d/iface/ [ "$INTERFACE" = "wan6" ] || exit 0 CRON_CMD='0 * * * * kill -SIGUSR1 $(pgrep odhcp6c)' if [ "$ACTION" = "ifup" ]; then grep -Fq "$CRON_CMD" /etc/crontabs/root || { echo "$CRON_CMD" >> /etc/crontabs/root /etc/init.d/cron restart } elif [ "$ACTION" = "ifdown" ]; then sed -i "/$(printf '%b' "$CRON_CMD" | sed 's:[\\/.*^$]:\\&:g')/d" /etc/crontabs/root /etc/init.d/cron restart fi