annotate etc/periodic/daily/800.local-ipv6-refresh @ 215:7d07c4e214ee

Allow to customize the traceroute target for the IPv6 refresh periodic task
author Franz Glasner <fzglas.hg@dom66.de>
date Thu, 25 Aug 2022 08:53:19 +0200
parents e292d85338b3
children 738fe7206eab
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
186
39e5b947a28e Create a periodic script to keep the IPv6 routing working.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
1 #!/bin/sh
39e5b947a28e Create a periodic script to keep the IPv6 routing working.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
2 #
39e5b947a28e Create a periodic script to keep the IPv6 routing working.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
3 # @(#)@@PKGORIGIN@@ $HGid$
39e5b947a28e Create a periodic script to keep the IPv6 routing working.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
4 #
187
f9ba0fb173fb Some comment the new periodic script
Franz Glasner <fzglas.hg@dom66.de>
parents: 186
diff changeset
5 # Daily script to keep the IPv6 routing working
f9ba0fb173fb Some comment the new periodic script
Franz Glasner <fzglas.hg@dom66.de>
parents: 186
diff changeset
6 #
186
39e5b947a28e Create a periodic script to keep the IPv6 routing working.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
7
39e5b947a28e Create a periodic script to keep the IPv6 routing working.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
8 # If there is a global system configuration file, suck it in.
39e5b947a28e Create a periodic script to keep the IPv6 routing working.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
9 if [ -r /etc/defaults/periodic.conf ]
39e5b947a28e Create a periodic script to keep the IPv6 routing working.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
10 then
39e5b947a28e Create a periodic script to keep the IPv6 routing working.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
11 . /etc/defaults/periodic.conf
39e5b947a28e Create a periodic script to keep the IPv6 routing working.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
12 source_periodic_confs
39e5b947a28e Create a periodic script to keep the IPv6 routing working.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
13 fi
39e5b947a28e Create a periodic script to keep the IPv6 routing working.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
14
39e5b947a28e Create a periodic script to keep the IPv6 routing working.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
15 #
39e5b947a28e Create a periodic script to keep the IPv6 routing working.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
16 # Source in RC configurations also because we need the value of the
39e5b947a28e Create a periodic script to keep the IPv6 routing working.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
17 # IPv6 default router (if any).
39e5b947a28e Create a periodic script to keep the IPv6 routing working.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
18 #
39e5b947a28e Create a periodic script to keep the IPv6 routing working.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
19 if [ -r /etc/defaults/rc.conf ]
39e5b947a28e Create a periodic script to keep the IPv6 routing working.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
20 then
39e5b947a28e Create a periodic script to keep the IPv6 routing working.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
21 . /etc/defaults/rc.conf
39e5b947a28e Create a periodic script to keep the IPv6 routing working.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
22 source_rc_confs
39e5b947a28e Create a periodic script to keep the IPv6 routing working.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
23 fi
39e5b947a28e Create a periodic script to keep the IPv6 routing working.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
24
188
cf4097c83691 Allow enabling and disabling the daily local-ipv6-refresh script by periodic configuration variables.
Franz Glasner <fzglas.hg@dom66.de>
parents: 187
diff changeset
25 #
cf4097c83691 Allow enabling and disabling the daily local-ipv6-refresh script by periodic configuration variables.
Franz Glasner <fzglas.hg@dom66.de>
parents: 187
diff changeset
26 # Default configuration variables
cf4097c83691 Allow enabling and disabling the daily local-ipv6-refresh script by periodic configuration variables.
Franz Glasner <fzglas.hg@dom66.de>
parents: 187
diff changeset
27 #
cf4097c83691 Allow enabling and disabling the daily local-ipv6-refresh script by periodic configuration variables.
Franz Glasner <fzglas.hg@dom66.de>
parents: 187
diff changeset
28 : ${daily_local_ipv6_refresh_enable:="NO"}
cf4097c83691 Allow enabling and disabling the daily local-ipv6-refresh script by periodic configuration variables.
Franz Glasner <fzglas.hg@dom66.de>
parents: 187
diff changeset
29 : ${daily_local_ipv6_refresh_flags:="-n -w2 -q2 -m1 -I"}
215
7d07c4e214ee Allow to customize the traceroute target for the IPv6 refresh periodic task
Franz Glasner <fzglas.hg@dom66.de>
parents: 189
diff changeset
30 : ${daily_local_ipv6_refresh_target:="${ipv6_defaultrouter}"}
188
cf4097c83691 Allow enabling and disabling the daily local-ipv6-refresh script by periodic configuration variables.
Franz Glasner <fzglas.hg@dom66.de>
parents: 187
diff changeset
31
186
39e5b947a28e Create a periodic script to keep the IPv6 routing working.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
32 rc=0
39e5b947a28e Create a periodic script to keep the IPv6 routing working.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
33
188
cf4097c83691 Allow enabling and disabling the daily local-ipv6-refresh script by periodic configuration variables.
Franz Glasner <fzglas.hg@dom66.de>
parents: 187
diff changeset
34 # Go on only if this script is enabled in the configuration
cf4097c83691 Allow enabling and disabling the daily local-ipv6-refresh script by periodic configuration variables.
Franz Glasner <fzglas.hg@dom66.de>
parents: 187
diff changeset
35 case "${daily_local_ipv6_refresh_enable}" in
cf4097c83691 Allow enabling and disabling the daily local-ipv6-refresh script by periodic configuration variables.
Franz Glasner <fzglas.hg@dom66.de>
parents: 187
diff changeset
36 [Yy][Ee][Ss])
cf4097c83691 Allow enabling and disabling the daily local-ipv6-refresh script by periodic configuration variables.
Franz Glasner <fzglas.hg@dom66.de>
parents: 187
diff changeset
37 ;;
cf4097c83691 Allow enabling and disabling the daily local-ipv6-refresh script by periodic configuration variables.
Franz Glasner <fzglas.hg@dom66.de>
parents: 187
diff changeset
38 [Nn][Oo])
cf4097c83691 Allow enabling and disabling the daily local-ipv6-refresh script by periodic configuration variables.
Franz Glasner <fzglas.hg@dom66.de>
parents: 187
diff changeset
39 exit 0
cf4097c83691 Allow enabling and disabling the daily local-ipv6-refresh script by periodic configuration variables.
Franz Glasner <fzglas.hg@dom66.de>
parents: 187
diff changeset
40 ;;
cf4097c83691 Allow enabling and disabling the daily local-ipv6-refresh script by periodic configuration variables.
Franz Glasner <fzglas.hg@dom66.de>
parents: 187
diff changeset
41 *)
cf4097c83691 Allow enabling and disabling the daily local-ipv6-refresh script by periodic configuration variables.
Franz Glasner <fzglas.hg@dom66.de>
parents: 187
diff changeset
42 echo 1>&2 "$0: WARNING: \$daily_local_ipv6_refresh_enable is not set properly - assuming \"NO\" has been set"
cf4097c83691 Allow enabling and disabling the daily local-ipv6-refresh script by periodic configuration variables.
Franz Glasner <fzglas.hg@dom66.de>
parents: 187
diff changeset
43 exit 0
cf4097c83691 Allow enabling and disabling the daily local-ipv6-refresh script by periodic configuration variables.
Franz Glasner <fzglas.hg@dom66.de>
parents: 187
diff changeset
44 ;;
189
e292d85338b3 Handle empty $ipv6_defaultrouter values more explicitely
Franz Glasner <fzglas.hg@dom66.de>
parents: 188
diff changeset
45 esac
188
cf4097c83691 Allow enabling and disabling the daily local-ipv6-refresh script by periodic configuration variables.
Franz Glasner <fzglas.hg@dom66.de>
parents: 187
diff changeset
46
215
7d07c4e214ee Allow to customize the traceroute target for the IPv6 refresh periodic task
Franz Glasner <fzglas.hg@dom66.de>
parents: 189
diff changeset
47 case "${daily_local_ipv6_refresh_target}" in
7d07c4e214ee Allow to customize the traceroute target for the IPv6 refresh periodic task
Franz Glasner <fzglas.hg@dom66.de>
parents: 189
diff changeset
48 "NO")
7d07c4e214ee Allow to customize the traceroute target for the IPv6 refresh periodic task
Franz Glasner <fzglas.hg@dom66.de>
parents: 189
diff changeset
49 # SKIP because no target or no static IPv6 router given
7d07c4e214ee Allow to customize the traceroute target for the IPv6 refresh periodic task
Franz Glasner <fzglas.hg@dom66.de>
parents: 189
diff changeset
50 echo 1>&2 "$0: WARNING: \$daily_local_ipv6_refresh_target is \`NO'"
186
39e5b947a28e Create a periodic script to keep the IPv6 routing working.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
51 ;;
189
e292d85338b3 Handle empty $ipv6_defaultrouter values more explicitely
Franz Glasner <fzglas.hg@dom66.de>
parents: 188
diff changeset
52 '')
e292d85338b3 Handle empty $ipv6_defaultrouter values more explicitely
Franz Glasner <fzglas.hg@dom66.de>
parents: 188
diff changeset
53 # SKIP because this is an unresolvable router specification
e292d85338b3 Handle empty $ipv6_defaultrouter values more explicitely
Franz Glasner <fzglas.hg@dom66.de>
parents: 188
diff changeset
54 echo 1>&2 "$0: WARNING: \$ipv6_defaultrouter has an unexpected empty value"
e292d85338b3 Handle empty $ipv6_defaultrouter values more explicitely
Franz Glasner <fzglas.hg@dom66.de>
parents: 188
diff changeset
55 ;;
188
cf4097c83691 Allow enabling and disabling the daily local-ipv6-refresh script by periodic configuration variables.
Franz Glasner <fzglas.hg@dom66.de>
parents: 187
diff changeset
56 *)
186
39e5b947a28e Create a periodic script to keep the IPv6 routing working.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
57 if type anticongestion >/dev/null 2>&1; then
188
cf4097c83691 Allow enabling and disabling the daily local-ipv6-refresh script by periodic configuration variables.
Franz Glasner <fzglas.hg@dom66.de>
parents: 187
diff changeset
58 anticongestion_sleeptime=60
cf4097c83691 Allow enabling and disabling the daily local-ipv6-refresh script by periodic configuration variables.
Franz Glasner <fzglas.hg@dom66.de>
parents: 187
diff changeset
59 anticongestion
186
39e5b947a28e Create a periodic script to keep the IPv6 routing working.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
60 fi
215
7d07c4e214ee Allow to customize the traceroute target for the IPv6 refresh periodic task
Franz Glasner <fzglas.hg@dom66.de>
parents: 189
diff changeset
61 /usr/sbin/traceroute6 ${daily_local_ipv6_refresh_flags} "${daily_local_ipv6_refresh_target}"
186
39e5b947a28e Create a periodic script to keep the IPv6 routing working.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
62 rc=$?
39e5b947a28e Create a periodic script to keep the IPv6 routing working.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
63 ;;
39e5b947a28e Create a periodic script to keep the IPv6 routing working.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
64 esac
39e5b947a28e Create a periodic script to keep the IPv6 routing working.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
65
39e5b947a28e Create a periodic script to keep the IPv6 routing working.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff changeset
66 exit $rc