comparison etc/periodic/daily/800.local-ipv6-refresh @ 353:d71f9efac6a8

Enhance 800.local-ipv6-refresh: no need to include "rc.conf" and friends directly: use sysrc instead. This allows working with jails in future versions also.
author Franz Glasner <fzglas.hg@dom66.de>
date Thu, 08 Dec 2022 00:46:28 +0100
parents 619a32c6baaa
children 84d2735fe7f6
comparison
equal deleted inserted replaced
352:619a32c6baaa 353:d71f9efac6a8
11 . /etc/defaults/periodic.conf 11 . /etc/defaults/periodic.conf
12 source_periodic_confs 12 source_periodic_confs
13 fi 13 fi
14 14
15 # 15 #
16 # Source in RC configurations also because we need the value of the
17 # IPv6 default router (if any).
18 #
19 if [ -r /etc/defaults/rc.conf ]
20 then
21 . /etc/defaults/rc.conf
22 source_rc_confs
23 fi
24
25 #
26 # Default configuration variables 16 # Default configuration variables
27 # 17 #
28 : ${daily_local_ipv6_refresh_enable:="NO"} 18 : ${daily_local_ipv6_refresh_enable:="NO"}
29 : ${daily_local_ipv6_refresh_flags="-n -w2 -q2 -m1 -I"} 19 : ${daily_local_ipv6_refresh_flags="-n -w2 -q2 -m1 -I"}
30 : ${daily_local_ipv6_refresh_target:="${ipv6_defaultrouter}"} 20 : ${daily_local_ipv6_refresh_target=""}
31 21
32 rc=0 22 rc=0
33 23
34 # Go on only if this script is enabled in the configuration 24 # Go on only if this script is enabled in the configuration
35 case "${daily_local_ipv6_refresh_enable}" in 25 case "${daily_local_ipv6_refresh_enable}" in
42 echo "$0: WARNING: \$daily_local_ipv6_refresh_enable is not set properly - assuming \"NO\" has been set" 1>&2 32 echo "$0: WARNING: \$daily_local_ipv6_refresh_enable is not set properly - assuming \"NO\" has been set" 1>&2
43 exit 0 33 exit 0
44 ;; 34 ;;
45 esac 35 esac
46 36
37 if [ -z "${daily_local_ipv6_refresh_target}" ]; then
38 daily_local_ipv6_refresh_target="$(/usr/sbin/sysrc -i -n ipv6_defaultrouter)"
39 fi
40
47 case "${daily_local_ipv6_refresh_target}" in 41 case "${daily_local_ipv6_refresh_target}" in
48 "NO") 42 [Nn][Oo])
49 # SKIP because no target or no static IPv6 router given 43 # SKIP because no target or no static IPv6 router given
50 echo "$0: WARNING: \$daily_local_ipv6_refresh_target is \`NO'" 1>&2 44 echo "$0: WARNING: \$daily_local_ipv6_refresh_target is \`NO'" 1>&2
51 ;; 45 ;;
52 '') 46 '')
53 # SKIP because this is an unresolvable router specification 47 # SKIP because this is an unresolvable router specification