bridge(4): document net.link.bridge.pfil_onlyip
[dragonfly.git] / etc / rc.d / cleanvar
blobd636bb06b4ba97a3e30c95e9835f4aede79fb86d
1 #!/bin/sh
3 # $FreeBSD: src/etc/rc.d/cleanvar,v 1.5 2003/07/14 13:02:36 mtm Exp $
6 # PROVIDE: cleanvar
7 # REQUIRE: mountcritlocal
8 # BEFORE: FILESYSTEMS
10 . /etc/rc.subr
11 dummy_rc_command "$1"
13 # use recursion and shell test, because /usr/bin/find is not yet mounted
15 purgedir()
17 local dir file
19 if [ $# -eq 0 ]; then
20 purgedir .
21 else
22 for dir
25 cd "$dir" && for file in .* *
27 [ ."$file" = .. -o ."$file" = ... ] && continue
28 if [ -d "$file" -a ! -L "$file" ]
29 then
30 purgedir "$file"
31 else
32 rm -f -- "$file"
34 done
36 done
40 # These files must be removed only the first time this script is run
41 # on boot.
43 [ "$1" != "reload" ] && rm -f /var/run/clean_var /var/spool/lock/clean_var
45 # purge /var/run /var/spool/lock and /var/spool/uucp/.Temp/*
47 if [ -d /var/run -a ! -f /var/run/clean_var ]; then
48 purgedir /var/run
49 # And an initial utmpx file
50 (cd /var/run && cp /dev/null utmpx && chmod 644 utmpx;)
51 >/var/run/clean_var
53 if [ -d /var/spool/lock -a ! -f /var/spool/lock/clean_var ]; then
54 purgedir /var/spool/lock
55 >/var/spool/lock/clean_var
57 rm -rf /var/spool/uucp/.Temp/*