1 #!/bin/sh 2 # 3 # $NetBSD: cleartmp,v 1.2 2000/05/13 08:45:06 lukem Exp $ 4 # 5 6 # PROVIDE: cleartmp 7 # REQUIRE: mountall 8 9 . /etc/rc.subr 10 11 name="cleartmp" 12 start_cmd="cleartmp_start" 13 start_precmd="checkyesno clear_tmp" 14 stop_cmd=":" 15 16 cleartmp_start() 17 { 18 echo "Clearing /tmp." 19 # 20 # Prune quickly with one rm, then use find to clean up 21 # /tmp/[lq]* (this is not needed with mfs /tmp, but 22 # doesn't hurt anything). 23 # 24 (cd /tmp && rm -rf [a-km-pr-zA-Z]* && 25 find -x . ! -name . ! -name lost+found ! -name quota.user \ 26 ! -name quota.group -exec rm -rf -- {} \; -type d -prune) 27 } 28 29 load_rc_config $name 30 run_rc_command "$1" 31