view etc/periodic/daily/800.local-ipv6-refresh @ 186:39e5b947a28e

Create a periodic script to keep the IPv6 routing working. Just added from existing sources.
author Franz Glasner <fzglas.hg@dom66.de>
date Fri, 19 Aug 2022 01:17:02 +0200
parents
children f9ba0fb173fb
line wrap: on
line source

#!/bin/sh
#
# @(#)@@PKGORIGIN@@ $HGid$
#

# If there is a global system configuration file, suck it in.
if [ -r /etc/defaults/periodic.conf ]
then
    . /etc/defaults/periodic.conf
    source_periodic_confs
fi

#
# Source in RC configurations also because we need the value of the
# IPv6 default router (if any).
#
if [ -r /etc/defaults/rc.conf ]
then
    . /etc/defaults/rc.conf
    source_rc_confs
fi

rc=0

case "${ipv6_defaultrouter}" in
  [Nn][Oo])
    # SKIP because no IP static IPv6 router given
    ;;
  *)
    if type anticongestion >/dev/null 2>&1; then
      anticongestion_sleeptime=60
      anticongestion
    fi
    /usr/sbin/traceroute6 -n -w2 -q2 -m1 -I "${ipv6_defaultrouter}"
    rc=$?
    ;;
esac

exit $rc