Skip to content

Instantly share code, notes, and snippets.

@missing233
Last active October 25, 2024 06:10
Show Gist options
  • Save missing233/3dafb6ee549ed2271c20bd700b88a9cd to your computer and use it in GitHub Desktop.
Save missing233/3dafb6ee549ed2271c20bd700b88a9cd to your computer and use it in GitHub Desktop.

Revisions

  1. missing233 revised this gist Jan 28, 2024. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions 70-flets-cross-dhcpv6-renew
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,5 @@
    #!/bin/sh
    # Place in /etc/hotplug.d/iface/

    [ "$INTERFACE" = "wan6" ] || exit 0

  2. missing233 created this gist Oct 14, 2023.
    15 changes: 15 additions & 0 deletions 70-flets-cross-dhcpv6-renew
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    #!/bin/sh

    [ "$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