drcut-kdump.sh: cleanup kdump.conf check
move conf_file as a global variable to the top. vivek: return earlier if kdump.conf is not found in read_kdump_conf to avoid the deep indent. Signed-off-by: Dave Young <dyoung@redhat.com> Acked-by: Vivek Goyal <vgoyal@redhat.com>
This commit is contained in:
parent
16e24a1197
commit
33d933f800
@ -13,6 +13,7 @@ KDUMP_SCRIPT_DIR="/kdumpscripts"
|
|||||||
DD_BLKSIZE=512
|
DD_BLKSIZE=512
|
||||||
FINAL_ACTION="reboot -f"
|
FINAL_ACTION="reboot -f"
|
||||||
DUMP_RETVAL=0
|
DUMP_RETVAL=0
|
||||||
|
conf_file="/etc/kdump.conf"
|
||||||
|
|
||||||
export PATH=$PATH:$KDUMP_SCRIPT_DIR
|
export PATH=$PATH:$KDUMP_SCRIPT_DIR
|
||||||
|
|
||||||
@ -124,8 +125,11 @@ dump_ssh()
|
|||||||
|
|
||||||
read_kdump_conf()
|
read_kdump_conf()
|
||||||
{
|
{
|
||||||
local conf_file="/etc/kdump.conf"
|
if [ ! -f "$conf_file" ]; then
|
||||||
if [ -f "$conf_file" ]; then
|
echo "$conf_file not found"
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
# first get the necessary variables
|
# first get the necessary variables
|
||||||
while read config_opt config_val;
|
while read config_opt config_val;
|
||||||
do
|
do
|
||||||
@ -180,7 +184,6 @@ read_kdump_conf()
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
done < $conf_file
|
done < $conf_file
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
read_kdump_conf
|
read_kdump_conf
|
||||||
|
Loading…
Reference in New Issue
Block a user