cb23468e75
If one of the scripts listed in (daily|weekly|monthly)_local is executable, 999.local should simply execute it. Only if the script isn't executable should 999.local assume it needs /bin/sh. Reviewed by: brian MFC after: 3 weeks Sponsored by: Spectra Logic Corp
44 lines
723 B
Bash
Executable File
44 lines
723 B
Bash
Executable File
#!/bin/sh
|
|
#
|
|
# $FreeBSD$
|
|
#
|
|
# Run the old /etc/daily.local script. This is really for backwards
|
|
# compatibility more than anything else.
|
|
#
|
|
|
|
# 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
|
|
|
|
rc=0
|
|
for script in $daily_local
|
|
do
|
|
echo ''
|
|
case "$script" in
|
|
/*)
|
|
if [ -x "$script" ]
|
|
then
|
|
echo "Running $script:"
|
|
|
|
$script || rc=3
|
|
elif [ -f "$script" ]
|
|
then
|
|
echo "Running $script:"
|
|
|
|
sh $script || rc=3
|
|
else
|
|
echo "$script: No such file"
|
|
[ $rc -lt 2 ] && rc=2
|
|
fi;;
|
|
*)
|
|
echo "$script: Not an absolute path"
|
|
[ $rc -lt 2 ] && rc=2;;
|
|
esac
|
|
done
|
|
|
|
exit $rc
|