Modify methods name: *_redhat to *_centos.

This commit is contained in:
Samson-W 2020-03-06 03:57:46 +08:00
parent 4bb01e5c2e
commit 3b61a0e406
26 changed files with 99 additions and 99 deletions

View File

@ -30,7 +30,7 @@ audit_debian ()
fi fi
} }
audit_redhat () audit_centos ()
{ {
info "Checking if yum needs an update" info "Checking if yum needs an update"
info "Fetching upgrades ..." info "Fetching upgrades ..."
@ -50,7 +50,7 @@ audit ()
if [ $OS_RELEASE -eq 1 ]; then if [ $OS_RELEASE -eq 1 ]; then
audit_debian audit_debian
elif [ $OS_RELEASE -eq 2 ]; then elif [ $OS_RELEASE -eq 2 ]; then
audit_redhat audit_centos
else else
crit "Current OS is not support!" crit "Current OS is not support!"
FNRET=44 FNRET=44
@ -67,7 +67,7 @@ apply_debian ()
fi fi
} }
apply_redhat () apply_centos ()
{ {
if [ $FNRET -eq 100 ]; then if [ $FNRET -eq 100 ]; then
info "Applying Upgrades..." info "Applying Upgrades..."
@ -85,7 +85,7 @@ apply ()
if [ $OS_RELEASE -eq 1 ]; then if [ $OS_RELEASE -eq 1 ]; then
apply_debian apply_debian
elif [ $OS_RELEASE -eq 2 ]; then elif [ $OS_RELEASE -eq 2 ]; then
apply_redhat apply_centos
else else
crit "Current OS is not support!" crit "Current OS is not support!"
fi fi

View File

@ -28,7 +28,7 @@ audit_debian ()
fi fi
} }
audit_redhat () audit_centos ()
{ {
if [ $(grep -c "^$YUM_OPTION" $YUM_CONF) -gt 0 ]; then if [ $(grep -c "^$YUM_OPTION" $YUM_CONF) -gt 0 ]; then
if [ $(grep "^$YUM_OPTION" $YUM_CONF | awk -F"=" '{print $2}') -eq 1 ]; then if [ $(grep "^$YUM_OPTION" $YUM_CONF | awk -F"=" '{print $2}') -eq 1 ]; then
@ -50,7 +50,7 @@ audit ()
if [ $OS_RELEASE -eq 1 ]; then if [ $OS_RELEASE -eq 1 ]; then
audit_debian audit_debian
elif [ $OS_RELEASE -eq 2 ]; then elif [ $OS_RELEASE -eq 2 ]; then
audit_redhat audit_centos
else else
crit "Current OS is not support!" crit "Current OS is not support!"
FNRET=44 FNRET=44
@ -70,7 +70,7 @@ apply_debian () {
done done
fi fi
} }
apply_redhat () { apply_centos () {
if [ $FNRET = 0 ]; then if [ $FNRET = 0 ]; then
ok "The signature of packages option is enable " ok "The signature of packages option is enable "
elif [ $FNRET = 1 ]; then elif [ $FNRET = 1 ]; then
@ -87,7 +87,7 @@ apply () {
if [ $OS_RELEASE -eq 1 ]; then if [ $OS_RELEASE -eq 1 ]; then
apply_debian apply_debian
elif [ $OS_RELEASE -eq 2 ]; then elif [ $OS_RELEASE -eq 2 ]; then
apply_redhat apply_centos
else else
crit "Current OS is not support!" crit "Current OS is not support!"
fi fi

View File

@ -29,7 +29,7 @@ audit_debian () {
fi fi
} }
audit_redhat () audit_centos ()
{ {
if [ $(grep -c "^$YUM_OPTION" $YUM_CONFFILE) -gt 0 ]; then if [ $(grep -c "^$YUM_OPTION" $YUM_CONFFILE) -gt 0 ]; then
if [ $(grep "^$YUM_OPTION" $YUM_CONFFILE | awk -F"=" '{print $2}') -eq 1 ]; then if [ $(grep "^$YUM_OPTION" $YUM_CONFFILE | awk -F"=" '{print $2}') -eq 1 ]; then
@ -51,7 +51,7 @@ audit()
if [ $OS_RELEASE -eq 1 ]; then if [ $OS_RELEASE -eq 1 ]; then
audit_debian audit_debian
elif [ $OS_RELEASE -eq 2 ]; then elif [ $OS_RELEASE -eq 2 ]; then
audit_redhat audit_centos
else else
crit "Current OS is not support!" crit "Current OS is not support!"
FNRET=44 FNRET=44
@ -68,7 +68,7 @@ apply_debian () {
fi fi
} }
apply_redhat () { apply_centos () {
if [ $FNRET = 0 ]; then if [ $FNRET = 0 ]; then
ok "The signature of packages option is enable " ok "The signature of packages option is enable "
elif [ $FNRET = 1 ]; then elif [ $FNRET = 1 ]; then
@ -86,7 +86,7 @@ apply () {
if [ $OS_RELEASE -eq 1 ]; then if [ $OS_RELEASE -eq 1 ]; then
apply_debian apply_debian
elif [ $OS_RELEASE -eq 2 ]; then elif [ $OS_RELEASE -eq 2 ]; then
apply_redhat apply_centos
else else
crit "Current OS is not support!" crit "Current OS is not support!"
fi fi

View File

@ -28,7 +28,7 @@ audit_debian () {
fi fi
} }
audit_redhat () audit_centos ()
{ {
if [ $(grep -c "^$YUM_OPTION" $YUM_CONFFILE) -gt 0 ]; then if [ $(grep -c "^$YUM_OPTION" $YUM_CONFFILE) -gt 0 ]; then
if [ $(grep "^$YUM_OPTION" $YUM_CONFFILE | awk -F"=" '{print $2}') -eq 1 ]; then if [ $(grep "^$YUM_OPTION" $YUM_CONFFILE | awk -F"=" '{print $2}') -eq 1 ]; then
@ -49,7 +49,7 @@ audit () {
if [ $OS_RELEASE -eq 1 ]; then if [ $OS_RELEASE -eq 1 ]; then
audit_debian audit_debian
elif [ $OS_RELEASE -eq 2 ]; then elif [ $OS_RELEASE -eq 2 ]; then
audit_redhat audit_centos
else else
crit "Current OS is not support!" crit "Current OS is not support!"
FNRET=44 FNRET=44
@ -68,7 +68,7 @@ apply_debian () {
fi fi
} }
apply_redhat () { apply_centos () {
if [ $FNRET = 0 ]; then if [ $FNRET = 0 ]; then
ok "The signature of repodata option is enable " ok "The signature of repodata option is enable "
elif [ $FNRET = 1 ]; then elif [ $FNRET = 1 ]; then
@ -85,7 +85,7 @@ apply () {
if [ $OS_RELEASE -eq 1 ]; then if [ $OS_RELEASE -eq 1 ]; then
apply_debian apply_debian
elif [ $OS_RELEASE -eq 2 ]; then elif [ $OS_RELEASE -eq 2 ]; then
apply_redhat apply_centos
else else
crit "Current OS is not support!" crit "Current OS is not support!"
fi fi

View File

@ -46,7 +46,7 @@ audit_debian () {
fi fi
} }
audit_redhat () { audit_centos () {
SSH_PARAM=$(echo $OPTIONS | cut -d= -f 1) SSH_PARAM=$(echo $OPTIONS | cut -d= -f 1)
SSH_VALUE=$(echo $OPTIONS | cut -d= -f 2) SSH_VALUE=$(echo $OPTIONS | cut -d= -f 2)
INACTIVE_V=$(useradd -D | grep $SSH_PARAM | awk -F= '{print $2}') INACTIVE_V=$(useradd -D | grep $SSH_PARAM | awk -F= '{print $2}')
@ -64,7 +64,7 @@ audit () {
if [ $OS_RELEASE -eq 1 ]; then if [ $OS_RELEASE -eq 1 ]; then
audit_debian audit_debian
elif [ $OS_RELEASE -eq 2 ]; then elif [ $OS_RELEASE -eq 2 ]; then
audit_redhat audit_centos
else else
warn "Current OS is not support!" warn "Current OS is not support!"
fi fi
@ -106,7 +106,7 @@ apply_debian () {
fi fi
} }
apply_redhat () { apply_centos () {
SSH_PARAM=$(echo $OPTIONS | cut -d= -f 1) SSH_PARAM=$(echo $OPTIONS | cut -d= -f 1)
SSH_VALUE=$(echo $OPTIONS | cut -d= -f 2) SSH_VALUE=$(echo $OPTIONS | cut -d= -f 2)
PATTERN="^$SSH_PARAM=$SSH_VALUE" PATTERN="^$SSH_PARAM=$SSH_VALUE"
@ -147,7 +147,7 @@ apply () {
if [ $OS_RELEASE -eq 1 ]; then if [ $OS_RELEASE -eq 1 ]; then
apply_debian apply_debian
elif [ $OS_RELEASE -eq 2 ]; then elif [ $OS_RELEASE -eq 2 ]; then
apply_redhat apply_centos
else else
warn "Current OS is not support!" warn "Current OS is not support!"
fi fi

View File

@ -37,7 +37,7 @@ audit_debian () {
fi fi
} }
audit_redhat () { audit_centos () {
SSH_PARAM=$(echo $OPTION | cut -d= -f 1) SSH_PARAM=$(echo $OPTION | cut -d= -f 1)
SSH_VALUE=$(echo $OPTION | cut -d= -f 2) SSH_VALUE=$(echo $OPTION | cut -d= -f 2)
PATTERN="^$SSH_PARAM[[:space:]]*[[:digit:]]*" PATTERN="^$SSH_PARAM[[:space:]]*[[:digit:]]*"
@ -60,7 +60,7 @@ audit_redhat () {
# This function will be called if the script status is on enabled / audit mode # This function will be called if the script status is on enabled / audit mode
audit () { audit () {
if [ $OS_RELEASE -eq 2 ]; then if [ $OS_RELEASE -eq 2 ]; then
audit_redhat audit_centos
else else
audit_debian audit_debian
fi fi
@ -86,7 +86,7 @@ apply_debian () {
fi fi
} }
apply_redhat () { apply_centos () {
if [ $FNRET = 0 ]; then if [ $FNRET = 0 ]; then
ok "$SSH_PARAM is set least four seconds between logon prompts following a failed console logon attempt" ok "$SSH_PARAM is set least four seconds between logon prompts following a failed console logon attempt"
elif [ $FNRET = 1 ]; then elif [ $FNRET = 1 ]; then
@ -103,7 +103,7 @@ apply_redhat () {
# This function will be called if the script status is on enabled mode # This function will be called if the script status is on enabled mode
apply () { apply () {
if [ $OS_RELEASE -eq 2 ]; then if [ $OS_RELEASE -eq 2 ]; then
apply_redhat apply_centos
else else
apply_debian apply_debian
fi fi

View File

@ -37,7 +37,7 @@ audit_debian () {
fi fi
} }
audit_redhat () { audit_centos () {
is_service_active $SERVICE_NAME is_service_active $SERVICE_NAME
if [ $FNRET -eq 0 ]; then if [ $FNRET -eq 0 ]; then
crit "$SERVICE_NAME is actived" crit "$SERVICE_NAME is actived"
@ -53,7 +53,7 @@ audit () {
if [ $OS_RELEASE -eq 1 ]; then if [ $OS_RELEASE -eq 1 ]; then
audit_debian audit_debian
elif [ $OS_RELEASE -eq 2 ]; then elif [ $OS_RELEASE -eq 2 ]; then
audit_redhat audit_centos
else else
crit "Current OS is not support!" crit "Current OS is not support!"
FNRET=44 FNRET=44
@ -80,7 +80,7 @@ apply_debian () {
} }
apply_redhat () { apply_centos () {
if [ $FNRET -eq 1 ]; then if [ $FNRET -eq 1 ]; then
info "Disabling $SERVICE_NAME" info "Disabling $SERVICE_NAME"
systemctl stop $SERVICE_NAME systemctl stop $SERVICE_NAME
@ -95,7 +95,7 @@ apply () {
if [ $OS_RELEASE -eq 1 ]; then if [ $OS_RELEASE -eq 1 ]; then
apply_debian apply_debian
elif [ $OS_RELEASE -eq 2 ]; then elif [ $OS_RELEASE -eq 2 ]; then
apply_redhat apply_centos
else else
crit "Current OS is not support!" crit "Current OS is not support!"
fi fi

View File

@ -50,7 +50,7 @@ audit_debian () {
} }
# Todo # Todo
audit_redhat () { audit_centos () {
: :
} }
@ -59,7 +59,7 @@ audit () {
if [ $OS_RELEASE -eq 1 ]; then if [ $OS_RELEASE -eq 1 ]; then
audit_debian audit_debian
elif [ $OS_RELEASE -eq 2 ]; then elif [ $OS_RELEASE -eq 2 ]; then
audit_redhat audit_centos
else else
crit "Current OS is not support!" crit "Current OS is not support!"
FNRET=44 FNRET=44
@ -86,7 +86,7 @@ apply_debian () {
} }
# Todo # Todo
apply_redhat () { apply_centos () {
: :
} }
@ -95,7 +95,7 @@ apply () {
if [ $OS_RELEASE -eq 1 ]; then if [ $OS_RELEASE -eq 1 ]; then
apply_debian apply_debian
elif [ $OS_RELEASE -eq 2 ]; then elif [ $OS_RELEASE -eq 2 ]; then
apply_redhat apply_centos
else else
crit "Current OS is not support!" crit "Current OS is not support!"
fi fi

View File

@ -55,7 +55,7 @@ audit_debian () {
fi fi
} }
audit_redhat () { audit_centos () {
: :
} }
@ -64,7 +64,7 @@ audit () {
if [ $OS_RELEASE -eq 1 ]; then if [ $OS_RELEASE -eq 1 ]; then
audit_debian audit_debian
elif [ $OS_RELEASE -eq 2 ]; then elif [ $OS_RELEASE -eq 2 ]; then
audit_redhat audit_centos
else else
crit "Current OS is not support!" crit "Current OS is not support!"
FNRET=44 FNRET=44

View File

@ -42,7 +42,7 @@ audit_debian () {
done done
} }
audit_redhat () { audit_centos () {
is_pkg_installed $PACKAGE_REDHAT is_pkg_installed $PACKAGE_REDHAT
if [ $FNRET = 0 ]; then if [ $FNRET = 0 ]; then
crit "$PACKAGE_REDHAT is installed!" crit "$PACKAGE_REDHAT is installed!"
@ -55,7 +55,7 @@ audit () {
if [ $OS_RELEASE -eq 1 ]; then if [ $OS_RELEASE -eq 1 ]; then
audit_debian audit_debian
elif [ $OS_RELEASE -eq 2 ]; then elif [ $OS_RELEASE -eq 2 ]; then
audit_redhat audit_centos
else else
crit "Current OS is not support!" crit "Current OS is not support!"
FNRET=44 FNRET=44
@ -90,7 +90,7 @@ apply_debian () {
done done
} }
apply_redhat () { apply_centos () {
is_pkg_installed $PACKAGE_REDHAT is_pkg_installed $PACKAGE_REDHAT
if [ $FNRET = 0 ]; then if [ $FNRET = 0 ]; then
crit "$PACKAGE_REDHAT is installed, purging it" crit "$PACKAGE_REDHAT is installed, purging it"
@ -105,7 +105,7 @@ apply () {
if [ $OS_RELEASE -eq 1 ]; then if [ $OS_RELEASE -eq 1 ]; then
apply_debian apply_debian
elif [ $OS_RELEASE -eq 2 ]; then elif [ $OS_RELEASE -eq 2 ]; then
apply_redhat apply_centos
else else
crit "Current OS is not support!" crit "Current OS is not support!"
fi fi

View File

@ -41,7 +41,7 @@ audit_debian () {
done done
} }
audit_redhat () { audit_centos () {
for PACKAGE in $PACKAGES_REDHAT; do for PACKAGE in $PACKAGES_REDHAT; do
is_pkg_installed $PACKAGE is_pkg_installed $PACKAGE
if [ $FNRET = 0 ]; then if [ $FNRET = 0 ]; then
@ -57,7 +57,7 @@ audit () {
if [ $OS_RELEASE -eq 1 ]; then if [ $OS_RELEASE -eq 1 ]; then
audit_debian audit_debian
elif [ $OS_RELEASE -eq 2 ]; then elif [ $OS_RELEASE -eq 2 ]; then
audit_redhat audit_centos
else else
crit "Current OS is not support!" crit "Current OS is not support!"
FNRET=44 FNRET=44
@ -92,7 +92,7 @@ apply_debian () {
done done
} }
apply_redhat () { apply_centos () {
for PACKAGE in $PACKAGES_REDHAT; do for PACKAGE in $PACKAGES_REDHAT; do
is_pkg_installed $PACKAGE is_pkg_installed $PACKAGE
if [ $FNRET = 0 ]; then if [ $FNRET = 0 ]; then
@ -109,7 +109,7 @@ apply () {
if [ $OS_RELEASE -eq 1 ]; then if [ $OS_RELEASE -eq 1 ]; then
apply_debian apply_debian
elif [ $OS_RELEASE -eq 2 ]; then elif [ $OS_RELEASE -eq 2 ]; then
apply_redhat apply_centos
else else
crit "Current OS is not support!" crit "Current OS is not support!"
fi fi

View File

@ -42,7 +42,7 @@ audit_debian () {
done done
} }
audit_redhat () { audit_centos () {
is_pkg_installed $PACKAGE_REDHAT is_pkg_installed $PACKAGE_REDHAT
if [ $FNRET = 0 ]; then if [ $FNRET = 0 ]; then
crit "$PACKAGE_REDHAT is installed" crit "$PACKAGE_REDHAT is installed"
@ -56,7 +56,7 @@ audit () {
if [ $OS_RELEASE -eq 1 ]; then if [ $OS_RELEASE -eq 1 ]; then
audit_debian audit_debian
elif [ $OS_RELEASE -eq 2 ]; then elif [ $OS_RELEASE -eq 2 ]; then
audit_redhat audit_centos
else else
crit "Current OS is not support!" crit "Current OS is not support!"
FNRET=44 FNRET=44
@ -91,7 +91,7 @@ apply_debian () {
done done
} }
apply_redhat () { apply_centos () {
is_pkg_installed $PACKAGE_REDHAT is_pkg_installed $PACKAGE_REDHAT
if [ $FNRET = 0 ]; then if [ $FNRET = 0 ]; then
crit "$PACKAGE_REDHAT is installed, purging it" crit "$PACKAGE_REDHAT is installed, purging it"
@ -106,7 +106,7 @@ apply () {
if [ $OS_RELEASE -eq 1 ]; then if [ $OS_RELEASE -eq 1 ]; then
apply_debian apply_debian
elif [ $OS_RELEASE -eq 2 ]; then elif [ $OS_RELEASE -eq 2 ]; then
apply_redhat apply_centos
else else
crit "Current OS is not support!" crit "Current OS is not support!"
fi fi

View File

@ -43,7 +43,7 @@ audit_debian () {
} }
# todo # todo
audit_redhat () { audit_centos () {
: :
} }
@ -52,7 +52,7 @@ audit () {
if [ $OS_RELEASE -eq 1 ]; then if [ $OS_RELEASE -eq 1 ]; then
audit_debian audit_debian
elif [ $OS_RELEASE -eq 2 ]; then elif [ $OS_RELEASE -eq 2 ]; then
audit_redhat audit_centos
else else
crit "Current OS is not support!" crit "Current OS is not support!"
fi fi
@ -75,7 +75,7 @@ apply_debian () {
} }
# todo # todo
apply_redhat () { apply_centos () {
: :
} }
@ -84,7 +84,7 @@ apply () {
if [ $OS_RELEASE -eq 1 ]; then if [ $OS_RELEASE -eq 1 ]; then
apply_debian apply_debian
elif [ $OS_RELEASE -eq 2 ]; then elif [ $OS_RELEASE -eq 2 ]; then
apply_redhat apply_centos
else else
crit "Current OS is not support!" crit "Current OS is not support!"
fi fi

View File

@ -2,7 +2,7 @@
# #
# harbian-audit for Debian GNU/Linux 7/8/9 or CentOS Hardening # harbian-audit for Debian GNU/Linux 7/8/9 or CentOS Hardening
# todo base redhat7 v2r3 of STIG # todo base centos7 v2r3 of STIG
# #
# 6.19 Configure Network Time Protocol (NTP) (Scored) # 6.19 Configure Network Time Protocol (NTP) (Scored)

View File

@ -47,7 +47,7 @@ audit_debian () {
fi fi
} }
audit_redhat () { audit_centos () {
for PACKAGE in $PACKAGES_REDHAT for PACKAGE in $PACKAGES_REDHAT
do do
is_pkg_installed $PACKAGE is_pkg_installed $PACKAGE
@ -79,7 +79,7 @@ audit () {
if [ $OS_RELEASE -eq 1 ]; then if [ $OS_RELEASE -eq 1 ]; then
audit_debian audit_debian
elif [ $OS_RELEASE -eq 2 ]; then elif [ $OS_RELEASE -eq 2 ]; then
audit_redhat audit_centos
else else
crit "Current OS is not support!" crit "Current OS is not support!"
FNRET=44 FNRET=44
@ -108,7 +108,7 @@ apply_debian () {
fi fi
} }
apply_redhat () { apply_centos () {
if [ $FNRET = 0 ]; then if [ $FNRET = 0 ]; then
ok "$PACKAGES_REDHAT is installed" ok "$PACKAGES_REDHAT is installed"
elif [ $FNRET = 1 ]; then elif [ $FNRET = 1 ]; then
@ -138,7 +138,7 @@ apply () {
if [ $OS_RELEASE -eq 1 ]; then if [ $OS_RELEASE -eq 1 ]; then
apply_debian apply_debian
elif [ $OS_RELEASE -eq 2 ]; then elif [ $OS_RELEASE -eq 2 ]; then
apply_redhat apply_centos
else else
crit "Current OS is not support!" crit "Current OS is not support!"
FNRET=44 FNRET=44

View File

@ -51,7 +51,7 @@ audit_debian () {
fi fi
} }
audit_redhat () { audit_centos () {
check_param_pair_by_value $FILE_REDHAT $OPTIONNAME le $CONDT_VAL check_param_pair_by_value $FILE_REDHAT $OPTIONNAME le $CONDT_VAL
if [ $FNRET = 0 ]; then if [ $FNRET = 0 ]; then
ok "Option $OPTIONNAME set condition is less than or equal to $CONDT_VAL in $FILE_REDHAT" ok "Option $OPTIONNAME set condition is less than or equal to $CONDT_VAL in $FILE_REDHAT"
@ -69,7 +69,7 @@ audit () {
if [ $OS_RELEASE -eq 1 ]; then if [ $OS_RELEASE -eq 1 ]; then
audit_debian audit_debian
elif [ $OS_RELEASE -eq 2 ]; then elif [ $OS_RELEASE -eq 2 ]; then
audit_redhat audit_centos
else else
crit "Current OS is not support!" crit "Current OS is not support!"
FNRET=44 FNRET=44
@ -96,7 +96,7 @@ apply_debian () {
fi fi
} }
apply_redhat () { apply_centos () {
if [ $FNRET = 0 ]; then if [ $FNRET = 0 ]; then
ok "$OPTIONNAME set condition is less than or equal to $CONDT_VAL in $FILE_REDHAT" ok "$OPTIONNAME set condition is less than or equal to $CONDT_VAL in $FILE_REDHAT"
elif [ $FNRET = 1 ]; then elif [ $FNRET = 1 ]; then
@ -115,7 +115,7 @@ apply () {
if [ $OS_RELEASE -eq 1 ]; then if [ $OS_RELEASE -eq 1 ]; then
apply_debian apply_debian
elif [ $OS_RELEASE -eq 2 ]; then elif [ $OS_RELEASE -eq 2 ]; then
apply_redhat apply_centos
else else
crit "Current OS is not support!" crit "Current OS is not support!"
fi fi

View File

@ -46,7 +46,7 @@ audit_debian () {
fi fi
} }
audit_redhat () { audit_centos () {
for FILE in $FILES; do for FILE in $FILES; do
does_pattern_exist_in_file $FILE $OPTIONNAME does_pattern_exist_in_file $FILE $OPTIONNAME
if [ $FNRET = 0 ]; then if [ $FNRET = 0 ]; then
@ -64,7 +64,7 @@ audit () {
if [ $OS_RELEASE -eq 1 ]; then if [ $OS_RELEASE -eq 1 ]; then
audit_debian audit_debian
elif [ $OS_RELEASE -eq 2 ]; then elif [ $OS_RELEASE -eq 2 ]; then
audit_redhat audit_centos
else else
crit "Current OS is not support!" crit "Current OS is not support!"
fi fi
@ -89,7 +89,7 @@ apply_debian () {
fi fi
} }
apply_redhat () { apply_centos () {
for FILE in $FILES; do for FILE in $FILES; do
does_pattern_exist_in_file $FILE $OPTIONNAME does_pattern_exist_in_file $FILE $OPTIONNAME
if [ $FNRET = 0 ]; then if [ $FNRET = 0 ]; then
@ -108,7 +108,7 @@ apply () {
if [ $OS_RELEASE -eq 1 ]; then if [ $OS_RELEASE -eq 1 ]; then
apply_debian apply_debian
elif [ $OS_RELEASE -eq 2 ]; then elif [ $OS_RELEASE -eq 2 ]; then
apply_redhat apply_centos
else else
crit "Current OS is not support!" crit "Current OS is not support!"
fi fi

View File

@ -55,7 +55,7 @@ audit_debian () {
fi fi
} }
audit_redhat () { audit_centos () {
for FILE in $FILES; do for FILE in $FILES; do
does_pattern_exist_in_file $FILE "$PATTERN.*$OPTIONNAME" does_pattern_exist_in_file $FILE "$PATTERN.*$OPTIONNAME"
if [ $FNRET -eq 0 ]; then if [ $FNRET -eq 0 ]; then
@ -71,7 +71,7 @@ audit () {
if [ $OS_RELEASE -eq 1 ]; then if [ $OS_RELEASE -eq 1 ]; then
audit_debian audit_debian
elif [ $OS_RELEASE -eq 2 ]; then elif [ $OS_RELEASE -eq 2 ]; then
audit_redhat audit_centos
else else
crit "Current OS is not support!" crit "Current OS is not support!"
FNRET=44 FNRET=44
@ -107,7 +107,7 @@ apply_debian () {
fi fi
} }
apply_redhat () { apply_centos () {
for FILE in $FILES; do for FILE in $FILES; do
does_pattern_exist_in_file $FILE "$PATTERN.*$OPTIONNAME" does_pattern_exist_in_file $FILE "$PATTERN.*$OPTIONNAME"
if [ $FNRET -eq 0 ]; then if [ $FNRET -eq 0 ]; then
@ -124,7 +124,7 @@ apply () {
if [ $OS_RELEASE -eq 1 ]; then if [ $OS_RELEASE -eq 1 ]; then
apply_debian apply_debian
elif [ $OS_RELEASE -eq 2 ]; then elif [ $OS_RELEASE -eq 2 ]; then
apply_redhat apply_centos
else else
crit "Current OS is not support!" crit "Current OS is not support!"
fi fi

View File

@ -51,7 +51,7 @@ audit_debian () {
fi fi
} }
audit_redhat () { audit_centos () {
check_param_pair_by_value $FILE_REDHAT $OPTIONNAME ge $CONDT_VAL check_param_pair_by_value $FILE_REDHAT $OPTIONNAME ge $CONDT_VAL
if [ $FNRET = 0 ]; then if [ $FNRET = 0 ]; then
ok "Option $OPTIONNAME set condition is greater than or equal to $CONDT_VAL in $FILE_REDHAT" ok "Option $OPTIONNAME set condition is greater than or equal to $CONDT_VAL in $FILE_REDHAT"
@ -69,7 +69,7 @@ audit () {
if [ $OS_RELEASE -eq 1 ]; then if [ $OS_RELEASE -eq 1 ]; then
audit_debian audit_debian
elif [ $OS_RELEASE -eq 2 ]; then elif [ $OS_RELEASE -eq 2 ]; then
audit_redhat audit_centos
else else
crit "Current OS is not support!" crit "Current OS is not support!"
FNRET=44 FNRET=44
@ -96,7 +96,7 @@ apply_debian () {
fi fi
} }
apply_redhat () { apply_centos () {
if [ $FNRET = 0 ]; then if [ $FNRET = 0 ]; then
ok "$OPTIONNAME set condition is greater than or equal to $CONDT_VAL in $FILE_REDHAT" ok "$OPTIONNAME set condition is greater than or equal to $CONDT_VAL in $FILE_REDHAT"
elif [ $FNRET = 1 ]; then elif [ $FNRET = 1 ]; then
@ -115,7 +115,7 @@ apply () {
if [ $OS_RELEASE -eq 1 ]; then if [ $OS_RELEASE -eq 1 ]; then
apply_debian apply_debian
elif [ $OS_RELEASE -eq 2 ]; then elif [ $OS_RELEASE -eq 2 ]; then
apply_redhat apply_centos
else else
crit "Current OS is not support!" crit "Current OS is not support!"
fi fi

View File

@ -51,7 +51,7 @@ audit_debian () {
fi fi
} }
audit_redhat () { audit_centos () {
check_param_pair_by_value $FILE_REDHAT $OPTIONNAME le $CONDT_VAL check_param_pair_by_value $FILE_REDHAT $OPTIONNAME le $CONDT_VAL
if [ $FNRET = 0 ]; then if [ $FNRET = 0 ]; then
ok "Option $OPTIONNAME set condition is less than or equal to $CONDT_VAL in $FILE_REDHAT" ok "Option $OPTIONNAME set condition is less than or equal to $CONDT_VAL in $FILE_REDHAT"
@ -69,7 +69,7 @@ audit () {
if [ $OS_RELEASE -eq 1 ]; then if [ $OS_RELEASE -eq 1 ]; then
audit_debian audit_debian
elif [ $OS_RELEASE -eq 2 ]; then elif [ $OS_RELEASE -eq 2 ]; then
audit_redhat audit_centos
else else
crit "Current OS is not support!" crit "Current OS is not support!"
FNRET=44 FNRET=44
@ -96,7 +96,7 @@ apply_debian () {
fi fi
} }
apply_redhat () { apply_centos () {
if [ $FNRET = 0 ]; then if [ $FNRET = 0 ]; then
ok "$OPTIONNAME set condition is less than or equal to $CONDT_VAL in $FILE_REDHAT" ok "$OPTIONNAME set condition is less than or equal to $CONDT_VAL in $FILE_REDHAT"
elif [ $FNRET = 1 ]; then elif [ $FNRET = 1 ]; then
@ -115,7 +115,7 @@ apply () {
if [ $OS_RELEASE -eq 1 ]; then if [ $OS_RELEASE -eq 1 ]; then
apply_debian apply_debian
elif [ $OS_RELEASE -eq 2 ]; then elif [ $OS_RELEASE -eq 2 ]; then
apply_redhat apply_centos
else else
crit "Current OS is not support!" crit "Current OS is not support!"
fi fi

View File

@ -51,7 +51,7 @@ audit_debian () {
fi fi
} }
audit_redhat () { audit_centos () {
check_param_pair_by_value $FILE_REDHAT $OPTIONNAME le $CONDT_VAL check_param_pair_by_value $FILE_REDHAT $OPTIONNAME le $CONDT_VAL
if [ $FNRET = 0 ]; then if [ $FNRET = 0 ]; then
ok "Option $OPTIONNAME set condition is less than or equal to $CONDT_VAL in $FILE_REDHAT" ok "Option $OPTIONNAME set condition is less than or equal to $CONDT_VAL in $FILE_REDHAT"
@ -69,7 +69,7 @@ audit () {
if [ $OS_RELEASE -eq 1 ]; then if [ $OS_RELEASE -eq 1 ]; then
audit_debian audit_debian
elif [ $OS_RELEASE -eq 2 ]; then elif [ $OS_RELEASE -eq 2 ]; then
audit_redhat audit_centos
else else
crit "Current OS is not support!" crit "Current OS is not support!"
FNRET=44 FNRET=44
@ -97,7 +97,7 @@ apply_debian () {
fi fi
} }
apply_redhat () { apply_centos () {
if [ $FNRET = 0 ]; then if [ $FNRET = 0 ]; then
ok "$OPTIONNAME set condition is less than or equal to $CONDT_VAL in $FILE_REDHAT" ok "$OPTIONNAME set condition is less than or equal to $CONDT_VAL in $FILE_REDHAT"
elif [ $FNRET = 1 ]; then elif [ $FNRET = 1 ]; then
@ -116,7 +116,7 @@ apply () {
if [ $OS_RELEASE -eq 1 ]; then if [ $OS_RELEASE -eq 1 ]; then
apply_debian apply_debian
elif [ $OS_RELEASE -eq 2 ]; then elif [ $OS_RELEASE -eq 2 ]; then
apply_redhat apply_centos
else else
crit "Current OS is not support!" crit "Current OS is not support!"
fi fi

View File

@ -51,7 +51,7 @@ audit_debian () {
fi fi
} }
audit_redhat () { audit_centos () {
check_param_pair_by_value $FILE_REDHAT $OPTIONNAME le $CONDT_VAL check_param_pair_by_value $FILE_REDHAT $OPTIONNAME le $CONDT_VAL
if [ $FNRET = 0 ]; then if [ $FNRET = 0 ]; then
ok "Option $OPTIONNAME set condition is less than or equal to $CONDT_VAL in $FILE_REDHAT" ok "Option $OPTIONNAME set condition is less than or equal to $CONDT_VAL in $FILE_REDHAT"
@ -69,7 +69,7 @@ audit () {
if [ $OS_RELEASE -eq 1 ]; then if [ $OS_RELEASE -eq 1 ]; then
audit_debian audit_debian
elif [ $OS_RELEASE -eq 2 ]; then elif [ $OS_RELEASE -eq 2 ]; then
audit_redhat audit_centos
else else
crit "Current OS is not support!" crit "Current OS is not support!"
FNRET=44 FNRET=44
@ -96,7 +96,7 @@ apply_debian () {
fi fi
} }
apply_redhat () { apply_centos () {
if [ $FNRET = 0 ]; then if [ $FNRET = 0 ]; then
ok "$OPTIONNAME set condition is less than or equal to $CONDT_VAL in $FILE_REDHAT" ok "$OPTIONNAME set condition is less than or equal to $CONDT_VAL in $FILE_REDHAT"
elif [ $FNRET = 1 ]; then elif [ $FNRET = 1 ]; then
@ -115,7 +115,7 @@ apply () {
if [ $OS_RELEASE -eq 1 ]; then if [ $OS_RELEASE -eq 1 ]; then
apply_debian apply_debian
elif [ $OS_RELEASE -eq 2 ]; then elif [ $OS_RELEASE -eq 2 ]; then
apply_redhat apply_centos
else else
crit "Current OS is not support!" crit "Current OS is not support!"
fi fi

View File

@ -51,7 +51,7 @@ audit_debian () {
fi fi
} }
audit_redhat () { audit_centos () {
check_param_pair_by_value $FILE_REDHAT $OPTIONNAME le $CONDT_VAL check_param_pair_by_value $FILE_REDHAT $OPTIONNAME le $CONDT_VAL
if [ $FNRET = 0 ]; then if [ $FNRET = 0 ]; then
ok "Option $OPTIONNAME set condition is less than or equal to $CONDT_VAL in $FILE_REDHAT" ok "Option $OPTIONNAME set condition is less than or equal to $CONDT_VAL in $FILE_REDHAT"
@ -69,7 +69,7 @@ audit () {
if [ $OS_RELEASE -eq 1 ]; then if [ $OS_RELEASE -eq 1 ]; then
audit_debian audit_debian
elif [ $OS_RELEASE -eq 2 ]; then elif [ $OS_RELEASE -eq 2 ]; then
audit_redhat audit_centos
else else
crit "Current OS is not support!" crit "Current OS is not support!"
FNRET=44 FNRET=44
@ -96,7 +96,7 @@ apply_debian () {
fi fi
} }
apply_redhat () { apply_centos () {
if [ $FNRET = 0 ]; then if [ $FNRET = 0 ]; then
ok "$OPTIONNAME set condition is less than or equal to $CONDT_VAL in $FILE_REDHAT" ok "$OPTIONNAME set condition is less than or equal to $CONDT_VAL in $FILE_REDHAT"
elif [ $FNRET = 1 ]; then elif [ $FNRET = 1 ]; then
@ -115,7 +115,7 @@ apply () {
if [ $OS_RELEASE -eq 1 ]; then if [ $OS_RELEASE -eq 1 ]; then
apply_debian apply_debian
elif [ $OS_RELEASE -eq 2 ]; then elif [ $OS_RELEASE -eq 2 ]; then
apply_redhat apply_centos
else else
crit "Current OS is not support!" crit "Current OS is not support!"
fi fi

View File

@ -51,7 +51,7 @@ audit_debian () {
fi fi
} }
audit_redhat () { audit_centos () {
check_param_pair_by_value $FILE_REDHAT $OPTIONNAME ge $CONDT_VAL check_param_pair_by_value $FILE_REDHAT $OPTIONNAME ge $CONDT_VAL
if [ $FNRET = 0 ]; then if [ $FNRET = 0 ]; then
ok "Option $OPTIONNAME set condition is greater than or equal to $CONDT_VAL in $FILE_REDHAT" ok "Option $OPTIONNAME set condition is greater than or equal to $CONDT_VAL in $FILE_REDHAT"
@ -69,7 +69,7 @@ audit () {
if [ $OS_RELEASE -eq 1 ]; then if [ $OS_RELEASE -eq 1 ]; then
audit_debian audit_debian
elif [ $OS_RELEASE -eq 2 ]; then elif [ $OS_RELEASE -eq 2 ]; then
audit_redhat audit_centos
else else
crit "Current OS is not support!" crit "Current OS is not support!"
FNRET=44 FNRET=44
@ -96,7 +96,7 @@ apply_debian () {
fi fi
} }
apply_redhat () { apply_centos () {
if [ $FNRET = 0 ]; then if [ $FNRET = 0 ]; then
ok "$OPTIONNAME set condition is greater than or equal to $CONDT_VAL in $FILE_REDHAT" ok "$OPTIONNAME set condition is greater than or equal to $CONDT_VAL in $FILE_REDHAT"
elif [ $FNRET = 1 ]; then elif [ $FNRET = 1 ]; then
@ -115,7 +115,7 @@ apply () {
if [ $OS_RELEASE -eq 1 ]; then if [ $OS_RELEASE -eq 1 ]; then
apply_debian apply_debian
elif [ $OS_RELEASE -eq 2 ]; then elif [ $OS_RELEASE -eq 2 ]; then
apply_redhat apply_centos
else else
crit "Current OS is not support!" crit "Current OS is not support!"
fi fi

View File

@ -51,7 +51,7 @@ audit_debian () {
fi fi
} }
audit_redhat () { audit_centos () {
check_param_pair_by_value $FILE_REDHAT $OPTIONNAME ge $CONDT_VAL check_param_pair_by_value $FILE_REDHAT $OPTIONNAME ge $CONDT_VAL
if [ $FNRET = 0 ]; then if [ $FNRET = 0 ]; then
ok "Option $OPTIONNAME set condition is greater than or equal to $CONDT_VAL in $FILE_REDHAT" ok "Option $OPTIONNAME set condition is greater than or equal to $CONDT_VAL in $FILE_REDHAT"
@ -69,7 +69,7 @@ audit () {
if [ $OS_RELEASE -eq 1 ]; then if [ $OS_RELEASE -eq 1 ]; then
audit_debian audit_debian
elif [ $OS_RELEASE -eq 2 ]; then elif [ $OS_RELEASE -eq 2 ]; then
audit_redhat audit_centos
else else
crit "Current OS is not support!" crit "Current OS is not support!"
FNRET=44 FNRET=44
@ -96,7 +96,7 @@ apply_debian () {
fi fi
} }
apply_redhat () { apply_centos () {
if [ $FNRET = 0 ]; then if [ $FNRET = 0 ]; then
ok "$OPTIONNAME set condition is greater than or equal to $CONDT_VAL in $FILE_REDHAT" ok "$OPTIONNAME set condition is greater than or equal to $CONDT_VAL in $FILE_REDHAT"
elif [ $FNRET = 1 ]; then elif [ $FNRET = 1 ]; then
@ -115,7 +115,7 @@ apply () {
if [ $OS_RELEASE -eq 1 ]; then if [ $OS_RELEASE -eq 1 ]; then
apply_debian apply_debian
elif [ $OS_RELEASE -eq 2 ]; then elif [ $OS_RELEASE -eq 2 ]; then
apply_redhat apply_centos
else else
crit "Current OS is not support!" crit "Current OS is not support!"
fi fi

View File

@ -51,7 +51,7 @@ audit_debian () {
fi fi
} }
audit_redhat () { audit_centos () {
check_param_pair_by_value $FILE_REDHAT $OPTIONNAME le $CONDT_VAL check_param_pair_by_value $FILE_REDHAT $OPTIONNAME le $CONDT_VAL
if [ $FNRET = 0 ]; then if [ $FNRET = 0 ]; then
ok "Option $OPTIONNAME set condition is less than or equal to $CONDT_VAL in $FILE_REDHAT" ok "Option $OPTIONNAME set condition is less than or equal to $CONDT_VAL in $FILE_REDHAT"
@ -69,7 +69,7 @@ audit () {
if [ $OS_RELEASE -eq 1 ]; then if [ $OS_RELEASE -eq 1 ]; then
audit_debian audit_debian
elif [ $OS_RELEASE -eq 2 ]; then elif [ $OS_RELEASE -eq 2 ]; then
audit_redhat audit_centos
else else
crit "Current OS is not support!" crit "Current OS is not support!"
FNRET=44 FNRET=44
@ -96,7 +96,7 @@ apply_debian () {
fi fi
} }
apply_redhat () { apply_centos () {
if [ $FNRET = 0 ]; then if [ $FNRET = 0 ]; then
ok "$OPTIONNAME set condition is less than or equal to $CONDT_VAL in $FILE_REDHAT" ok "$OPTIONNAME set condition is less than or equal to $CONDT_VAL in $FILE_REDHAT"
elif [ $FNRET = 1 ]; then elif [ $FNRET = 1 ]; then
@ -115,7 +115,7 @@ apply () {
if [ $OS_RELEASE -eq 1 ]; then if [ $OS_RELEASE -eq 1 ]; then
apply_debian apply_debian
elif [ $OS_RELEASE -eq 2 ]; then elif [ $OS_RELEASE -eq 2 ]; then
apply_redhat apply_centos
else else
crit "Current OS is not support!" crit "Current OS is not support!"
fi fi