18e45614eSMatthew Dillon#!/bin/sh
28e45614eSMatthew Dillon#
38e45614eSMatthew Dillon# cleanup pass on all mounted hammer2 filesystems
48e45614eSMatthew Dillon
58e45614eSMatthew Dillon# If there is a global system configuration file, suck it in.
68e45614eSMatthew Dillon#
78e45614eSMatthew Dillonif [ -r /etc/defaults/periodic.conf ]
88e45614eSMatthew Dillonthen
98e45614eSMatthew Dillon    . /etc/defaults/periodic.conf
108e45614eSMatthew Dillon    source_periodic_confs
118e45614eSMatthew Dillonfi
128e45614eSMatthew Dillon
138e45614eSMatthew Dilloncase "$daily_clean_hammer2_enable" in
148e45614eSMatthew Dillon    [Yy][Ee][Ss])
158e45614eSMatthew Dillon	echo ""
162e3f71c3SSascha Wildner	echo "HAMMER2 maintenance:"
178e45614eSMatthew Dillon	case "$daily_clean_hammer2_verbose" in
188e45614eSMatthew Dillon	    [Yy][Ee][Ss])
198e45614eSMatthew Dillon		verbose=-v;;
208e45614eSMatthew Dillon	    *)
218e45614eSMatthew Dillon		verbose=;;
228e45614eSMatthew Dillon	esac
238e45614eSMatthew Dillon
24*5fe2bc09SMatthew Dillon	/usr/bin/lockf -k -t 0 /var/run/.daily.161.lck \
258c1e7cffSThomas Nikolajsen	hammer2 $verbose cleanup $daily_clean_hammer2_pfslist && rc=0;;
268e45614eSMatthew Dillon
278e45614eSMatthew Dillon    *)  rc=0;;
288e45614eSMatthew Dillonesac
298e45614eSMatthew Dillon
308e45614eSMatthew Dillonexit $rc
31