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

46 lines
1.0 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)
DEFAULT_ACTION="/bin/sh"
;;
reboot)
DEFAULT_ACTION="reboot -f"
;;
halt)
DEFAULT_ACTION="halt -f"
;;
poweroff)
DEFAULT_ACTION="poweroff -f"
;;
esac
;;
esac
done < $conf_file
fi
}
do_default_action()
{
2011-07-26 16:02:19 +00:00
$DEFAULT_ACTION
}