kexec-tools/kdump_dracut_modules/99kdumpbase/kdump-lib.sh

46 lines
1.1 KiB
Bash
Raw Normal View History

#!/bin/sh
KDUMP_PATH="/var/crash"
CORE_COLLECTOR="makedumpfile -d 31 -c"
2011-07-26 16:02:19 +00:00
DEFAULT_ACTION="reboot -f"
read_kdump_conf()
{
local conf_file="/etc/kdump.conf"
if [ -f "$conf_file" ]; then
while read config_opt config_val;
do
case "$config_opt" in
path)
KDUMP_PATH="$config_val"
;;
core_collector)
CORE_COLLECTOR="$config_val"
;;
default)
2011-07-26 16:02:19 +00:00
case $config_val in
shell)
2011-07-27 11:45:59 +00:00
DEFAULT_ACTION="emergency_shell"
2011-07-26 16:02:19 +00:00
;;
reboot)
DEFAULT_ACTION="/usr/bin/reboot -f"
2011-07-26 16:02:19 +00:00
;;
halt)
DEFAULT_ACTION="/usr/bin/halt -f"
2011-07-26 16:02:19 +00:00
;;
poweroff)
DEFAULT_ACTION="/usr/bin/poweroff -f"
2011-07-26 16:02:19 +00:00
;;
esac
;;
esac
done < $conf_file
fi
}
do_default_action()
{
2011-07-26 16:02:19 +00:00
$DEFAULT_ACTION
}