xref: /freebsd/usr.sbin/periodic/etc/monthly/999.local (revision d0b2dbfa0ecf2bbc9709efc5e20baf8e4b44bbbf)
1*81ea85a8SBrad Davis#!/bin/sh -
2*81ea85a8SBrad Davis#
3*81ea85a8SBrad Davis#
4*81ea85a8SBrad Davis
5*81ea85a8SBrad Davis# If there is a global system configuration file, suck it in.
6*81ea85a8SBrad Davis#
7*81ea85a8SBrad Davisif [ -r /etc/defaults/periodic.conf ]
8*81ea85a8SBrad Davisthen
9*81ea85a8SBrad Davis    . /etc/defaults/periodic.conf
10*81ea85a8SBrad Davis    source_periodic_confs
11*81ea85a8SBrad Davisfi
12*81ea85a8SBrad Davis
13*81ea85a8SBrad Davisrc=0
14*81ea85a8SBrad Davisfor script in $monthly_local
15*81ea85a8SBrad Davisdo
16*81ea85a8SBrad Davis    echo ''
17*81ea85a8SBrad Davis    case "$script" in
18*81ea85a8SBrad Davis	/*)
19*81ea85a8SBrad Davis	    if [ -x "$script" ]
20*81ea85a8SBrad Davis	    then
21*81ea85a8SBrad Davis		echo "Running $script:"
22*81ea85a8SBrad Davis
23*81ea85a8SBrad Davis		$script || rc=3
24*81ea85a8SBrad Davis	    elif [ -f "$script" ]
25*81ea85a8SBrad Davis	    then
26*81ea85a8SBrad Davis		echo "Running $script:"
27*81ea85a8SBrad Davis
28*81ea85a8SBrad Davis		sh $script || rc=3
29*81ea85a8SBrad Davis	    else
30*81ea85a8SBrad Davis		echo "$script: No such file"
31*81ea85a8SBrad Davis		[ $rc -lt 2 ] && rc=2
32*81ea85a8SBrad Davis	    fi;;
33*81ea85a8SBrad Davis	*)
34*81ea85a8SBrad Davis	    echo "$script: Not an absolute path"
35*81ea85a8SBrad Davis	    [ $rc -lt 2 ] && rc=2;;
36*81ea85a8SBrad Davis    esac
37*81ea85a8SBrad Davisdone
38*81ea85a8SBrad Davis
39*81ea85a8SBrad Davisexit $rc
40