Delete everything that's not a directory in /var/run and /var/spool/lock

at boot time.

MFC after: 3 weeks
This commit is contained in:
Brian Somers 2001-05-10 09:25:10 +00:00
parent af32b80c65
commit 44ced8b3c5
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=76430

7
etc/rc
View file

@ -312,9 +312,12 @@ purgedir() {
cd "$dir" && for file in .* *
do
[ ."$file" = .. -o ."$file" = ... ] && continue
[ -d "$file" -a ! -L "$file" ] &&
if [ -d "$file" -a ! -L "$file" ]
then
purgedir "$file"
[ -f "$file" -o -S "$file" ] && rm -f -- "$file"
else
rm -f -- "$file"
fi
done
)
done