Mercurial > hgrepos > FreeBSD > ports > sysutils > local-bsdtools
annotate etc/periodic/daily/800.local-ipv6-refresh @ 189:e292d85338b3
Handle empty $ipv6_defaultrouter values more explicitely
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Fri, 19 Aug 2022 02:00:20 +0200 |
| parents | cf4097c83691 |
| children | 7d07c4e214ee |
| 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"} |
|
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
|
30 |
|
186
39e5b947a28e
Create a periodic script to keep the IPv6 routing working.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
31 rc=0 |
|
39e5b947a28e
Create a periodic script to keep the IPv6 routing working.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
32 |
|
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
|
33 # 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
|
34 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
|
35 [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
|
36 ;; |
|
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 [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
|
38 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
|
39 ;; |
|
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 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
|
42 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
|
43 ;; |
|
189
e292d85338b3
Handle empty $ipv6_defaultrouter values more explicitely
Franz Glasner <fzglas.hg@dom66.de>
parents:
188
diff
changeset
|
44 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
|
45 |
|
186
39e5b947a28e
Create a periodic script to keep the IPv6 routing working.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
46 case "${ipv6_defaultrouter}" in |
|
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
|
47 [Nn][Oo]) |
|
186
39e5b947a28e
Create a periodic script to keep the IPv6 routing working.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
48 # SKIP because no IP static IPv6 router given |
|
39e5b947a28e
Create a periodic script to keep the IPv6 routing working.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
49 ;; |
|
189
e292d85338b3
Handle empty $ipv6_defaultrouter values more explicitely
Franz Glasner <fzglas.hg@dom66.de>
parents:
188
diff
changeset
|
50 '') |
|
e292d85338b3
Handle empty $ipv6_defaultrouter values more explicitely
Franz Glasner <fzglas.hg@dom66.de>
parents:
188
diff
changeset
|
51 # 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
|
52 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
|
53 ;; |
|
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
|
54 *) |
|
186
39e5b947a28e
Create a periodic script to keep the IPv6 routing working.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
55 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
|
56 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
|
57 anticongestion |
|
186
39e5b947a28e
Create a periodic script to keep the IPv6 routing working.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
58 fi |
|
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
|
59 /usr/sbin/traceroute6 ${daily_local_ipv6_refresh_flags} "${ipv6_defaultrouter}" |
|
186
39e5b947a28e
Create a periodic script to keep the IPv6 routing working.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
60 rc=$? |
|
39e5b947a28e
Create a periodic script to keep the IPv6 routing working.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
61 ;; |
|
39e5b947a28e
Create a periodic script to keep the IPv6 routing working.
Franz Glasner <fzglas.hg@dom66.de>
parents:
diff
changeset
|
62 esac |
|
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 exit $rc |
