Fix #42: 14.1 grep returns line format that will never match the regex filter applied

This commit is contained in:
Samson-W 2023-06-04 23:10:05 +08:00
parent 07f7f86612
commit 881c51608e
1 changed files with 1 additions and 1 deletions

View File

@ -1314,7 +1314,7 @@ check_sshd_conf_for_one_value_runtime ()
check_blacklist_module_set ()
{
MODPROBE_CONF_FILE_PATTERN="/etc/modprobe.d/*"
COUNT=$(grep -w $1 -r $MODPROBE_CONF_FILE_PATTERN | grep "^blacklist" | wc -l)
COUNT=$(grep -hw $1 -r $MODPROBE_CONF_FILE_PATTERN | sed -e 's/^[ ]*//g' |grep "^blacklist" | wc -l)
if [ $COUNT -ge 1 ]; then
debug "$1 has set in $MODPROBE_CONF_FILE_PATTERN"
FNRET=0