Skip to content

Commit cbe9a30

Browse files
committed
set via conf file
1 parent d62548a commit cbe9a30

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

usr.sbin/periodic/periodic.conf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,15 @@
1515
#
1616
#
1717

18+
_set_localbase() {
19+
_localbase=`/sbin/sysctl -n user.localbase 2> /dev/null`
20+
# Set default value of _localbase if not previously set
21+
: ${_localbase:="/usr/local"}
22+
}
23+
24+
# Set _localbase with fallback to /usr/local
25+
_set_localbase
26+
1827
# What files override these defaults ?
1928
periodic_conf_files="/etc/periodic.conf /etc/periodic.conf.local ${_localbase}/etc/periodic.conf"
2029

usr.sbin/periodic/periodic.sh

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,17 @@ if [ $# -lt 1 ] ; then
2929
usage
3030
fi
3131

32-
_localbase=`/sbin/sysctl -n user.localbase 2> /dev/null`
33-
# Set default value of _localbase if not previously set
34-
: ${_localbase:="/usr/local"}
35-
36-
# Use a deterministic path to match the preset from /etc/crontab in case
37-
# periodic is run interactively.
38-
export PATH=/sbin:/bin:/usr/sbin:/usr/bin:${_localbase}/sbin:${_localbase}/bin
39-
4032
# If possible, check the global system configuration file,
4133
# to see if there are additional dirs to check
4234
if [ -r /etc/defaults/periodic.conf ]; then
4335
. /etc/defaults/periodic.conf
4436
source_periodic_confs
4537
fi
4638

39+
# Use a deterministic path to match the preset from /etc/crontab in case
40+
# periodic is run interactively.
41+
export PATH=/sbin:/bin:/usr/sbin:/usr/bin:${_localbase}/sbin:${_localbase}/bin
42+
4743
host=`hostname`
4844
export host
4945

0 commit comments

Comments
 (0)