[BACK]Return to virecover CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / etc / rc.d

File: [cvs.NetBSD.org] / src / etc / rc.d / virecover (download)

Revision 1.4, Mon Oct 9 05:33:53 2000 UTC (19 years ago) by nisimura
Branch: MAIN
Changes since 1.3: +5 -9 lines

Use find(1) to search files in straight fashion with the cost of external
command invocation.

#!/bin/sh
#
# $NetBSD: virecover,v 1.4 2000/10/09 05:33:53 nisimura Exp $
#

# PROVIDE: virecover
# REQUIRE: mountcritremote
#
# XXX: should require `mail'!

. /etc/rc.subr

name="virecover"
start_cmd="virecover_start" 
stop_cmd=":"

virecover_start()
{
	recover=`find /var/tmp/vi.recover -name 'recover.*' -type f -print`
	if [ -n "$recover" ]; then
		echo "Preserving editor files."
		for i in $recover; do
			sendmail -t < $i
		done
	fi
}

load_rc_config $name
run_rc_command "$1"