Fix a bug for 6.1

This commit is contained in:
Samson-W 2020-06-21 04:55:34 +08:00
parent 72c0d63343
commit b93743847d

View File

@ -20,27 +20,35 @@ PACKAGES='xserver-xorg-core xserver-xorg-core-dbg xserver-common xserver-xephyr
# 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 () {
for PACKAGE in $PACKAGES; do for PACKAGE in $PACKAGES; do
is_pkg_installed $PACKAGE is_pkg_installed $PACKAGE
if [ $FNRET = 0 ]; then if [ $FNRET = 0 ]; then
crit "$PACKAGE is installed!" if [ $ISEXCEPTION -eq 1 ]; then
else warn "$PACKAGE is installed! But Exception is set to 1, so it's pass!"
ok "$PACKAGE is absent" else
fi crit "$PACKAGE is installed!"
done fi
else
ok "$PACKAGE is absent"
fi
done
} }
# 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 () {
for PACKAGE in $PACKAGES; do for PACKAGE in $PACKAGES; do
is_pkg_installed $PACKAGE is_pkg_installed $PACKAGE
if [ $FNRET = 0 ]; then if [ $FNRET = 0 ]; then
crit "$PACKAGE is installed, purging it" if [ $ISEXCEPTION -eq 1 ]; then
uninstall_pkg $PACKAGE warn "$PACKAGE is installed! But Exception is set to 1, so it's pass!"
else else
ok "$PACKAGE is absent" crit "$PACKAGE is installed, purging it"
fi uninstall_pkg $PACKAGE
done fi
else
ok "$PACKAGE is absent"
fi
done
} }
# This function will create the config file for this check with default values # This function will create the config file for this check with default values