In fact "-x" has finished the check, which makes check_executable always
successful. Meanwhile, the checking is also done when kdump_install_pre_post_conf(),
so removing this extra check.
Signed-off-by: Pingfan Liu <piliu(a)redhat.com>
---
kdumpctl | 18 +++---------------
1 file changed, 3 insertions(+), 15 deletions(-)
diff --git a/kdumpctl b/kdumpctl
index 6e3ef74..273c07f 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -340,23 +340,11 @@ check_files_modified()
EXTRA_BINS=`grep ^kdump_post $KDUMP_CONFIG_FILE | cut -d\ -f2`
CHECK_FILES=`grep ^kdump_pre $KDUMP_CONFIG_FILE | cut -d\ -f2`
HOOKS_DIR="/etc/kdump/post.d/ /etc/kdump/pre.d/"
- if [ -d /etc/kdump/post.d ]; then
- for file in /etc/kdump/post.d/*; do
- if [ -x "$file" ]; then
- POST_FILES="$POST_FILES $file"
- fi
- done
- else
+ if [ ! -d /etc/kdump/post.d ]; then
echo "creating /etc/kdump/post.d"
mkdir -p /etc/kdump/post.d
fi
- if [ -d /etc/kdump/pre.d ]; then
- for file in /etc/kdump/pre.d/*; do
- if [ -x "$file" ]; then
- PRE_FILES="$PRE_FILES $file"
- fi
- done
- else
+ if [ ! -d /etc/kdump/pre.d ]; then
echo "creating /etc/kdump/pre.d"
mkdir -p /etc/kdump/pre.d
fi
@@ -390,7 +378,7 @@ check_files_modified()
done
fi
- check_exist "$files" && check_executable "$EXTRA_BINS $PRE_FILES
$POST_FILES"
+ check_exist "$files" && check_executable "$EXTRA_BINS"
[ $? -ne 0 ] && return 2
check_list="$files $HOOKS_DIR"
--
2.7.5