1 #!/bin/sh 2 # 3 # $NetBSD: virecover,v 1.1 2000/03/10 11:53:24 lukem Exp $ 4 # 5 6 # PROVIDE: virecover 7 # REQUIRE: systemfs 8 # 9 # XXX: should require `mail'! 10 11 . /etc/rc.subr 12 . /etc/rc.conf 13 14 name="virecover" 15 start_cmd="virecover_start" 16 stop_cmd=":" 17 18 virecover_start() 19 { 20 # XXX: replace me with a script that works! 21 # 22 virecovery=`echo /var/tmp/vi.recover/recover.*` 23 if [ "$virecovery" != "/var/tmp/vi.recover/recover.*" ]; then 24 echo "Preserving editor files." 25 for i in $virecovery; do 26 if [ -f $i ]; then 27 sendmail -t < $i 28 fi 29 done 30 fi 31 } 32 33 run_rc_command "$1" 34