View | Details | Raw Unified | Return to bug 62655
Collapse All | Expand All

(-)files/fetchaudit.sh (+9 lines)
Lines 52-66 Link Here
52
			echo ""
52
			echo ""
53
			echo "Updating audit database."
53
			echo "Updating audit database."
54
			cd "${portaudit_dir}"
54
			cd "${portaudit_dir}"
55
			cp "${portaudit_file}" "${portaudit_file}.old" \
56
			|| echo "Could not back-up ${portaudit_file}"
55
			fetch -1am ${LOCATIONS}
57
			fetch -1am ${LOCATIONS}
56
			if [ ! $? ]; then
58
			if [ ! $? ]; then
57
				echo "Couldn't fetch database."
59
				echo "Couldn't fetch database."
60
				echo "Restoring old database file ..."
61
				cp "${portaudit_file}.old" "${portaudit_file}"
58
				rc=2
62
				rc=2
59
			elif [ ! -f "${portaudit_file}" ] ; then
63
			elif [ ! -f "${portaudit_file}" ] ; then
60
				echo "no database."
64
				echo "no database."
65
                               echo "Trying to restore the old database file ..."
66
                               cp "${portaudit_file}.old" "${portaudit_file}"
61
				rc=2
67
				rc=2
62
			elif checksum_auditfile; then
68
			elif checksum_auditfile; then
63
				echo "database corrupt."
69
				echo "database corrupt."
70
                               echo "Restoring old database file ..."
71
                               cp "${portaudit_file}.old" "${portaudit_file}"
64
				rc=2
72
				rc=2
65
			elif checkexpiry_auditfile 7; then
73
			elif checkexpiry_auditfile 7; then
66
				echo "database too old."
74
				echo "database too old."
Lines 71-76 Link Here
71
			fi
79
			fi
72
		else
80
		else
73
			rc=0
81
			rc=0
82
			rm "${portaudit_file}.old" 2>/dev/null
74
		fi
83
		fi
75
	;;
84
	;;
76
	*)
85
	*)

Return to bug 62655