This cleanup patch removes unnecessary keyword "function" at all places in
kdumpctl script.
Signed-off-by: Hari Bathini <hbathini(a)linux.vnet.ibm.com>
---
kdumpctl | 42 +++++++++++++++++++++---------------------
1 file changed, 21 insertions(+), 21 deletions(-)
diff --git a/kdumpctl b/kdumpctl
index 02b32bc..79a11c5 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -54,7 +54,7 @@ determine_dump_mode()
# remove_cmdline_param <kernel cmdline> <param1> [<param2>] ...
[<paramN>]
# Remove a list of kernel parameters from a given kernel cmdline and print the result.
# For each "arg" in the removing params list, "arg" and
"arg=xxx" will be removed if exists.
-function remove_cmdline_param()
+remove_cmdline_param()
{
local cmdline=$1
shift
@@ -72,7 +72,7 @@ function remove_cmdline_param()
# This function returns the "initial apicid" of the
# boot cpu (cpu 0) if present.
#
-function get_bootcpu_initial_apicid()
+get_bootcpu_initial_apicid()
{
awk ' \
BEGIN { CPU = "-1"; } \
@@ -85,7 +85,7 @@ function get_bootcpu_initial_apicid()
#
# This function appends argument "$2=$3" to string ($1) if not already
present.
#
-function append_cmdline()
+append_cmdline()
{
local cmdline=$1
local newstr=${cmdline/$2/""}
@@ -99,7 +99,7 @@ function append_cmdline()
}
# This function performs a series of edits on the command line
-function prepare_cmdline()
+prepare_cmdline()
{
local cmdline;
if [ -z "$KDUMP_COMMANDLINE" ]; then
@@ -121,7 +121,7 @@ function prepare_cmdline()
}
-function save_core()
+save_core()
{
coredir="/var/crash/`date +"%Y-%m-%d-%H:%M"`"
@@ -189,7 +189,7 @@ rebuild_initrd()
}
#$1: the files to be checked with IFS=' '
-function check_exist()
+check_exist()
{
for file in $1; do
if [ ! -f "$file" ]; then
@@ -200,7 +200,7 @@ function check_exist()
}
#$1: the files to be checked with IFS=' '
-function check_executable()
+check_executable()
{
for file in $1; do
if [ ! -x "$file" ]; then
@@ -276,7 +276,7 @@ find_initrd_image_time()
fi
}
-function check_config()
+check_config()
{
local nr
@@ -342,7 +342,7 @@ get_pcs_cluster_modified_files()
echo $modified_files
}
-function check_rebuild()
+check_rebuild()
{
local extra_modules modified_files=""
local _force_rebuild force_rebuild="0"
@@ -409,7 +409,7 @@ function check_rebuild()
# This function check iomem and determines if we have more than
# 4GB of ram available. Returns 1 if we do, 0 if we dont
-function need_64bit_headers()
+need_64bit_headers()
{
return `tail -n 1 /proc/iomem | awk '{ split ($1, r, "-"); \
print (strtonum("0x" r[2]) > strtonum("0xffffffff")); }'`
@@ -418,7 +418,7 @@ function need_64bit_headers()
# Load the kdump kerel specified in /etc/sysconfig/kdump
# If none is specified, try to load a kdump kernel with the same version
# as the currently running kernel.
-function load_kdump()
+load_kdump()
{
MEM_RESERVED=$(cat /sys/kernel/kexec_crash_size)
if [ $MEM_RESERVED -eq 0 ]
@@ -465,7 +465,7 @@ function load_kdump()
fi
}
-function check_ssh_config()
+check_ssh_config()
{
while read config_opt config_val; do
# remove inline comments after the end of a directive.
@@ -498,7 +498,7 @@ function check_ssh_config()
return 0
}
-function check_ssh_target()
+check_ssh_target()
{
local _ret
ssh -q -i $SSH_KEY_LOCATION -o BatchMode=yes $DUMP_TARGET mkdir -p $SAVE_PATH
@@ -510,7 +510,7 @@ function check_ssh_target()
return 0
}
-function propagate_ssh_key()
+propagate_ssh_key()
{
check_ssh_config
if [ $? -ne 0 ]; then
@@ -566,7 +566,7 @@ check_current_fadump_status()
return 1
}
-function check_current_kdump_status()
+check_current_kdump_status()
{
rc=`cat /sys/kernel/kexec_crash_loaded`
if [ $rc == 1 ]; then
@@ -587,7 +587,7 @@ check_current_status()
return $?
}
-function save_raw()
+save_raw()
{
local kdump_dir
local raw_target
@@ -698,7 +698,7 @@ selinux_relabel()
# is 1 and SetupMode is 0, then secure boot is being enforced.
#
# Assume efivars is mounted at /sys/firmware/efi/efivars.
-function is_secure_boot_enforced()
+is_secure_boot_enforced()
{
local secure_boot_file setup_mode_file
local secure_boot_byte setup_mode_byte
@@ -718,7 +718,7 @@ function is_secure_boot_enforced()
return 1
}
-function check_kdump_feasibility()
+check_kdump_feasibility()
{
if is_secure_boot_enforced; then
echo "Secure Boot is Enabled. Kdump service can't be started. Disable Secure
Boot and retry"
@@ -731,7 +731,7 @@ function check_kdump_feasibility()
fi
}
-function check_fence_kdump_config()
+check_fence_kdump_config()
{
local hostname=`hostname`
local nodes=$(get_option_value "fence_kdump_nodes")
@@ -779,7 +779,7 @@ start_dump()
return $?
}
-function start()
+start()
{
check_config
if [ $? -ne 0 ]; then
@@ -854,7 +854,7 @@ stop_kdump()
return 0
}
-function stop()
+stop()
{
if [ $DUMP_MODE == "fadump" ]; then
stop_fadump