Modified 4.4 to be compatible with CentOS.

This commit is contained in:
Samson-W 2019-08-03 04:40:48 +08:00
parent 2a1d76d397
commit 74db39a3ae

View File

@ -1,7 +1,8 @@
#!/bin/bash #!/bin/bash
# #
# harbian audit 7/8/9 Hardening # harbian audit 7/8/9/10 or CentOS Hardening
# Modify by: Samson-W (samson@hardenedlinux.org)
# #
# #
@ -28,16 +29,26 @@ audit () {
# 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 () {
is_pkg_installed $PACKAGE if [ $OS_RELEASE -eq 2 ]; then
if [ $FNRET = 0 ]; then if [ $FNRET = 0 ]; then
crit "$PACKAGE is installed, purging it" crit "$PACKAGE is installed, purging it"
/usr/sbin/prelink -ua "$(which $PACKAGE)" -ua
apt-get purge $PACKAGE -y yum autoremove $PACKAGE -y
apt-get autoremove else
else ok "$PACKAGE is absent"
ok "$PACKAGE is absent" fi
fi elif [ $OS_RELEASE -eq 1 ]; then
: if [ $FNRET = 0 ]; then
crit "$PACKAGE is installed, purging it"
/usr/sbin/prelink -ua
apt-get purge $PACKAGE -y
apt-get autoremove
else
ok "$PACKAGE is absent"
fi
else
crit "Current OS is not support!"
fi
} }
# This function will check config parameters required # This function will check config parameters required