summaryrefslogtreecommitdiffstats
path: root/etc/rc.savecore
diff options
context:
space:
mode:
authorVinicius Coque <vinicius.coque@bluepex.com>2011-01-28 16:38:09 -0200
committerVinicius Coque <vinicius.coque@bluepex.com>2011-01-28 16:38:09 -0200
commit1596d9c17349f47ef06defa5c44333db0158a110 (patch)
tree4a3ee13deb4884dc67841f2b16eff691eb8c7411 /etc/rc.savecore
parenteac181cad00c25a90432ebbc35327ac9cfbed5b0 (diff)
parent20413b72bfd31282276c8ac2a116014f92914d4e (diff)
downloadpfsense-1596d9c17349f47ef06defa5c44333db0158a110.zip
pfsense-1596d9c17349f47ef06defa5c44333db0158a110.tar.gz
Merge remote branch 'mainline/master'
Diffstat (limited to 'etc/rc.savecore')
-rwxr-xr-xetc/rc.savecore22
1 files changed, 22 insertions, 0 deletions
diff --git a/etc/rc.savecore b/etc/rc.savecore
new file mode 100755
index 0000000..8685330
--- /dev/null
+++ b/etc/rc.savecore
@@ -0,0 +1,22 @@
+#!/bin/sh
+# Based on:
+# FreeBSD: src/etc/rc.d/savecore,v 1.16.2.2.4.1 2010/06/14 02:09:06 kensmith Exp
+
+dumpdev=`/bin/realpath /dev/dumpdev`
+dumpdir='/var/crash'
+
+if [ ! -c "${dumpdev}" ]; then
+ echo "Dump device does not exist. Savecore not run."
+ exit
+fi
+
+if [ ! -d "${dumpdir}" ]; then
+ echo "Dump directory does not exist. Savecore not run."
+ exit
+fi
+
+if savecore -C "${dumpdir}" "${dumpdev}" >/dev/null; then
+ savecore ${dumpdir} ${dumpdev}
+else
+ echo 'No core dumps found.'
+fi
OpenPOWER on IntegriCloud