changeset 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 487571161032
children f9ba0fb173fb
files Makefile etc/periodic/daily/800.local-ipv6-refresh pkg-plist
diffstat 3 files changed, 47 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile	Thu Aug 18 23:58:39 2022 +0200
+++ b/Makefile	Fri Aug 19 01:17:02 2022 +0200
@@ -45,8 +45,8 @@
 	${SED} -i "" -e "s|@@ETCDIR@@|${ETCDIR}|" ${WRKSRC}/${_rp}
 	${SED} -i "" -e "s|@@PKGORIGIN@@|${PKGORIGIN}|" ${WRKSRC}/${_rp}
 .endfor
-	${MKDIR} ${WRKSRC}/etc
-.for _ef in etc/package-mapping.conf.sample etc/pkgtools.conf.sample etc/bsmtp2dma.conf.sample
+	${MKDIR} ${WRKSRC}/etc/periodic/daily
+.for _ef in etc/package-mapping.conf.sample etc/pkgtools.conf.sample etc/bsmtp2dma.conf.sample etc/periodic/daily/800.local-ipv6-refresh
 	${CP} -v ${SRC}/${_ef} ${WRKSRC}/${_ef}
 	${SED} -i "" -e "s|\\\$$HGid\\\$$|\$$HGid: ${HGPATH}/${_ef} ${HGREVISION} ${HGDATE} ${HGAUTHOR} ${HGPHASE} \$$|" ${WRKSRC}/${_ef}
 	${SED} -i "" -e "s|@@PKGORIGIN@@|${PKGORIGIN}|" ${WRKSRC}/${_ef}
@@ -60,5 +60,10 @@
 .for _ef in package-mapping.conf.sample pkgtools.conf.sample bsmtp2dma.conf.sample
 	${INSTALL_DATA} ${WRKSRC}/etc/${_ef} ${STAGEDIR}${ETCDIR}/${_ef}
 .endfor
+	${MKDIR} ${STAGEDIR}${PREFIX}/etc/periodic/daily
+.for _ps in 800.local-ipv6-refresh
+	${INSTALL_SCRIPT} ${WRKSRC}/etc/periodic/daily/${_ps} ${STAGEDIR}${PREFIX}/etc/periodic/daily
+.endfor
+
 
 .include <bsd.port.mk>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/etc/periodic/daily/800.local-ipv6-refresh	Fri Aug 19 01:17:02 2022 +0200
@@ -0,0 +1,39 @@
+#!/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
--- a/pkg-plist	Thu Aug 18 23:58:39 2022 +0200
+++ b/pkg-plist	Fri Aug 19 01:17:02 2022 +0200
@@ -1,4 +1,5 @@
 @comment FILES
+etc/periodic/daily/800.local-ipv6-refresh
 sbin/bsmtp2dma
 sbin/check-ports
 sbin/fjail