aboutsummaryrefslogtreecommitdiff
path: root/etc/periodic/weekly/310.locate
diff options
context:
space:
mode:
authorBrian Somers <brian@FreeBSD.org>2000-06-23 01:18:31 +0000
committerBrian Somers <brian@FreeBSD.org>2000-06-23 01:18:31 +0000
commitf3e285ba7d9ba652ea61d3aca42e6b649ae9e981 (patch)
tree1d45e43f3d06b437f0125de60d0841c0cd040b70 /etc/periodic/weekly/310.locate
parent32ee60d7b865fd8b10a81a24f1a570261af2562a (diff)
downloadsrc-f3e285ba7d9ba652ea61d3aca42e6b649ae9e981.tar.gz
src-f3e285ba7d9ba652ea61d3aca42e6b649ae9e981.zip
Introduce /etc/defaults/periodic.conf, similar in concept to rc.conf.
The only change in the default functionality should be that the output reports are slightly more verbose WRT files deleted. Not objected to by: freebsd-arch
Notes
Notes: svn path=/head/; revision=61981
Diffstat (limited to 'etc/periodic/weekly/310.locate')
-rwxr-xr-xetc/periodic/weekly/310.locate32
1 files changed, 23 insertions, 9 deletions
diff --git a/etc/periodic/weekly/310.locate b/etc/periodic/weekly/310.locate
index b616a4ab4573..53d3d8001641 100755
--- a/etc/periodic/weekly/310.locate
+++ b/etc/periodic/weekly/310.locate
@@ -2,16 +2,30 @@
#
# $FreeBSD$
#
-locdb=/var/db/locate.database
-if [ -x /usr/libexec/locate.updatedb -a -f $locdb ] ; then
+# If there is a global system configuration file, suck it in.
+#
+if [ -r /etc/defaults/periodic.conf ]
+then
+ . /etc/defaults/periodic.conf
+ source_periodic_confs
+fi
- echo ""
- echo "Rebuilding locate database:"
+case "$weekly_locate_enable" in
+ [Yy][Ee][Ss])
+ if [ -x /usr/libexec/locate.updatedb -a -f $locdb ]
+ then
+ echo ""
+ echo "Rebuilding locate database:"
- touch ${locdb}; chown nobody ${locdb}; chmod 644 ${locdb}
+ locdb=/var/db/locate.database
- cd /
- echo /usr/libexec/locate.updatedb | nice -5 su -fm nobody
- chmod 444 ${locdb}
-fi
+ touch $locdb
+ chown nobody $locdb
+ chmod 644 $locdb
+
+ cd /
+ echo /usr/libexec/locate.updatedb | nice -5 su -fm nobody
+ chmod 444 $locdb
+ fi;;
+esac