summaryrefslogtreecommitdiffstats
path: root/src/etc/rc.savecore
blob: 1612a4051329ce02ac6ac8fe437eebcde9701a36 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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 "${dumpdev}" >/dev/null; then
	savecore ${dumpdir} ${dumpdev}
else
	echo 'No core dumps found.'
fi
OpenPOWER on IntegriCloud