comparison 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
comparison
equal deleted inserted replaced
214:b9cdf45a2d27 215:7d07c4e214ee
25 # 25 #
26 # Default configuration variables 26 # Default configuration variables
27 # 27 #
28 : ${daily_local_ipv6_refresh_enable:="NO"} 28 : ${daily_local_ipv6_refresh_enable:="NO"}
29 : ${daily_local_ipv6_refresh_flags:="-n -w2 -q2 -m1 -I"} 29 : ${daily_local_ipv6_refresh_flags:="-n -w2 -q2 -m1 -I"}
30 : ${daily_local_ipv6_refresh_target:="${ipv6_defaultrouter}"}
30 31
31 rc=0 32 rc=0
32 33
33 # Go on only if this script is enabled in the configuration 34 # Go on only if this script is enabled in the configuration
34 case "${daily_local_ipv6_refresh_enable}" in 35 case "${daily_local_ipv6_refresh_enable}" in
41 echo 1>&2 "$0: WARNING: \$daily_local_ipv6_refresh_enable is not set properly - assuming \"NO\" has been set" 42 echo 1>&2 "$0: WARNING: \$daily_local_ipv6_refresh_enable is not set properly - assuming \"NO\" has been set"
42 exit 0 43 exit 0
43 ;; 44 ;;
44 esac 45 esac
45 46
46 case "${ipv6_defaultrouter}" in 47 case "${daily_local_ipv6_refresh_target}" in
47 [Nn][Oo]) 48 "NO")
48 # SKIP because no IP static IPv6 router given 49 # SKIP because no target or no static IPv6 router given
50 echo 1>&2 "$0: WARNING: \$daily_local_ipv6_refresh_target is \`NO'"
49 ;; 51 ;;
50 '') 52 '')
51 # SKIP because this is an unresolvable router specification 53 # SKIP because this is an unresolvable router specification
52 echo 1>&2 "$0: WARNING: \$ipv6_defaultrouter has an unexpected empty value" 54 echo 1>&2 "$0: WARNING: \$ipv6_defaultrouter has an unexpected empty value"
53 ;; 55 ;;
54 *) 56 *)
55 if type anticongestion >/dev/null 2>&1; then 57 if type anticongestion >/dev/null 2>&1; then
56 anticongestion_sleeptime=60 58 anticongestion_sleeptime=60
57 anticongestion 59 anticongestion
58 fi 60 fi
59 /usr/sbin/traceroute6 ${daily_local_ipv6_refresh_flags} "${ipv6_defaultrouter}" 61 /usr/sbin/traceroute6 ${daily_local_ipv6_refresh_flags} "${daily_local_ipv6_refresh_target}"
60 rc=$? 62 rc=$?
61 ;; 63 ;;
62 esac 64 esac
63 65
64 exit $rc 66 exit $rc