#!/bin/sh# Based on:# FreeBSD: src/etc/rc.d/savecore,v 1.16.2.2.4.1 2010/06/14 02:09:06 kensmith Expdumpdev=`/bin/realpath /dev/dumpdev`dumpdir='/var/crash'if[!-c"${dumpdev}"];thenecho"Dump device does not exist. Savecore not run."exitfiif[!-d"${dumpdir}"];thenecho"Dump directory does not exist. Savecore not run."exitfiif savecore -C"${dumpdev}">/dev/null;thensavecore ${dumpdir}${dumpdev}elseecho'No core dumps found.'fi