changeset 188:cf4097c83691

Allow enabling and disabling the daily local-ipv6-refresh script by periodic configuration variables. Also allow the configuration of the traceroute6 flags that are to be used.
author Franz Glasner <fzglas.hg@dom66.de>
date Fri, 19 Aug 2022 01:46:16 +0200
parents f9ba0fb173fb
children e292d85338b3
files etc/periodic/daily/800.local-ipv6-refresh
diffstat 1 files changed, 24 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/etc/periodic/daily/800.local-ipv6-refresh	Fri Aug 19 01:19:10 2022 +0200
+++ b/etc/periodic/daily/800.local-ipv6-refresh	Fri Aug 19 01:46:16 2022 +0200
@@ -22,18 +22,37 @@
     source_rc_confs
 fi
 
+#
+# Default configuration variables
+#
+: ${daily_local_ipv6_refresh_enable:="NO"}
+: ${daily_local_ipv6_refresh_flags:="-n -w2 -q2 -m1 -I"}
+
 rc=0
 
+# Go on only if this script is enabled in the configuration
+case "${daily_local_ipv6_refresh_enable}" in
+[Yy][Ee][Ss])
+    ;;
+[Nn][Oo])
+    exit 0
+    ;;
+*)
+    echo 1>&2 "$0: WARNING: \$daily_local_ipv6_refresh_enable is not set properly - assuming \"NO\" has been set"
+    exit 0
+    ;;
+esac  
+
 case "${ipv6_defaultrouter}" in
-  [Nn][Oo])
+[Nn][Oo])
     # SKIP because no IP static IPv6 router given
     ;;
-  *)
+*)
     if type anticongestion >/dev/null 2>&1; then
-      anticongestion_sleeptime=60
-      anticongestion
+        anticongestion_sleeptime=60
+        anticongestion
     fi
-    /usr/sbin/traceroute6 -n -w2 -q2 -m1 -I "${ipv6_defaultrouter}"
+    /usr/sbin/traceroute6 ${daily_local_ipv6_refresh_flags} "${ipv6_defaultrouter}"
     rc=$?
     ;;
 esac