Update 9.2.2 for Debian12

This commit is contained in:
Samson-W 2023-06-12 01:23:48 +08:00
parent 3308bd7aa4
commit ab55dd82ee
2 changed files with 17 additions and 22 deletions

View File

@ -1,7 +1,7 @@
#!/bin/bash
#
# harbian-audit for Debian GNU/Linux 7/8/9/10 or CentOS Hardening
# harbian-audit for Debian GNU/Linux 7/8/9/10/11/12 or CentOS Hardening
#
#
@ -37,17 +37,6 @@ CONDT_VAL=3
# This function will be called if the script status is on enabled / audit mode
audit () {
if [ $OS_RELEASE -eq 2 ]; then
PACKAGE=$PACKAGE_CENTOS
PAMLIBNAME=$PAMLIBNAME_CENTOS
PATTERN=$PATTERN_CENTOS
FILE=$FILE_CENTOS
fi
if [ $OS_RELEASE -eq 11 -o $OS_RELEASE -eq 12 ]; then
PACKAGE=$PACKAGE_DEBIAN11
PAMLIBNAME=$PAMLIBNAME_DEBIAN11
PATTERN=$PATTERN_DEBIAN11
fi
is_pkg_installed $PACKAGE
if [ $FNRET != 0 ]; then
crit "$PACKAGE is not installed!"
@ -73,12 +62,6 @@ audit () {
# This function will be called if the script status is on enabled mode
apply () {
if [ $OS_RELEASE -eq 2 ]; then
PACKAGE=$PACKAGE_CENTOS
PAMLIBNAME=$PAMLIBNAME_CENTOS
PATTERN=$PATTERN_CENTOS
FILE=$FILE_CENTOS
fi
if [ $FNRET = 0 ]; then
ok "$PACKAGE is installed"
elif [ $FNRET = 1 ]; then
@ -104,7 +87,17 @@ apply () {
# This function will check config parameters required
check_config() {
:
if [ $OS_RELEASE -eq 2 ]; then
PACKAGE=$PACKAGE_CENTOS
PAMLIBNAME=$PAMLIBNAME_CENTOS
PATTERN=$PATTERN_CENTOS
FILE=$FILE_CENTOS
fi
if [ $OS_RELEASE -eq 11 -o $OS_RELEASE -eq 12 ]; then
PACKAGE=$PACKAGE_DEBIAN11
PAMLIBNAME=$PAMLIBNAME_DEBIAN11
PATTERN=$PATTERN_DEBIAN11
fi
}
# Source Root Dir Parameter

View File

@ -1,7 +1,7 @@
#!/bin/bash
#
# harbian-audit for Debian GNU/Linux 7/8/9/10 or CentOS Hardening
# harbian-audit for Debian GNU/Linux 7/8/9/10/11/12 or CentOS Hardening
#
#
@ -68,7 +68,8 @@ audit_centos () {
audit () {
if [ $OS_RELEASE -eq 1 ]; then
audit_debian
elif [ $OS_RELEASE -eq 2 ]; then
# debian11/debian12 default use pam_pwquality, same as centos
elif [ $OS_RELEASE -eq 2 -o $OS_RELEASE -eq 11 -o $OS_RELEASE -eq 12 ]; then
audit_centos
else
crit "Current OS is not support!"
@ -114,7 +115,8 @@ apply_centos () {
apply () {
if [ $OS_RELEASE -eq 1 ]; then
apply_debian
elif [ $OS_RELEASE -eq 2 ]; then
# debian11/debian12 default use pam_pwquality, same as centos
elif [ $OS_RELEASE -eq 2 -o $OS_RELEASE -eq 11 -o $OS_RELEASE -eq 12 ]; then
apply_centos
else
crit "Current OS is not support!"