Bug 48133

Summary: [patch] /etc/rc: improved vi recovery notification
Product: Base System Reporter: David Muir Sharnoff <muir>
Component: confAssignee: freebsd-bugs mailing list <bugs>
Status: Open ---    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.7-RELEASE   
Hardware: Any   
OS: Any   

Description David Muir Sharnoff 2003-02-10 10:00:25 UTC
	Ever reboot a system six times and get six notifications about
	a vi file that's available for recovery?

	Ever get notification too late 'cause you don't reboot that
	often?

Fix: 

In /etc/rc in the recovering files loop, add:
		
		if [ `expr "${i}" : '.*\.sent$'` -gt 0 ]; then
			continue
		fi

	and 

		mv "${i}" "${i}.sent"

	just after sendmail -t < "${i}"


    Add a new daily script that does the following:

	# Recover vi editor files.
	virecovery=`echo /var/tmp/vi.recover/recover.*`
	if [ "$virecovery" != '/var/tmp/vi.recover/recover.*' ]; then
		for i in $virecovery; do
			if [ `expr $i : '.*\.sent$'` -gt 0 ]; then
				continue
			fi
			virfn=`awk '/^X-vi-recover-path:/{print $2}' $i`
			if [ -r "$virfn" \
				-a `fstat "$virfn" | wc -l` -eq 1 \
				-a ! -x $i \
				-a -s $i \
				-a ! -e $i.sent \
			]; then
				sendmail -t < $i
				mv $i $i.sent
			fi
		done
	fi
Comment 1 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 07:59:35 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped