Optimize the method of uninstallation.

This commit is contained in:
Samson-W 2020-04-17 14:20:04 +08:00
parent 0333022739
commit 2678bb54b4
18 changed files with 22 additions and 80 deletions

View File

@ -33,7 +33,7 @@ apply () {
if [ $FNRET = 0 ]; then
crit "$PACKAGE is installed, purging it"
"$(which $PACKAGE)" -ua
yum autoremove $PACKAGE -y
uninstall_pkg $PACKAGE
else
ok "$PACKAGE is absent"
fi
@ -41,8 +41,7 @@ apply () {
if [ $FNRET = 0 ]; then
crit "$PACKAGE is installed, purging it"
/usr/sbin/prelink -ua
apt-get purge $PACKAGE -y
apt-get autoremove
uninstall_pkg $PACKAGE
else
ok "$PACKAGE is absent"
fi

View File

@ -39,12 +39,7 @@ apply () {
is_pkg_installed $PACKAGE
if [ $FNRET = 0 ]; then
crit "$PACKAGE is installed, purging it"
if [ $OS_RELEASE -eq 2 ]; then
yum -y autoremove $PACKAGE
else
apt-get purge $PACKAGE -y
apt-get autoremove
fi
uninstall_pkg $PACKAGE
else
ok "$PACKAGE is absent"
fi

View File

@ -67,8 +67,7 @@ apply_debian () {
is_pkg_installed $PACKAGE
if [ $FNRET = 0 ]; then
crit "$PACKAGE is installed, purging it"
apt-get purge $PACKAGE -y
apt-get autoremove
uninstall_pkg $PACKAGE
else
ok "$PACKAGE is absent"
fi
@ -94,7 +93,7 @@ apply_centos () {
is_pkg_installed $PACKAGE_CENTOS
if [ $FNRET = 0 ]; then
crit "$PACKAGE_CENTOS is installed, purging it"
yum -y remove $PACKAGE_CENTOS
uninstall_pkg $PACKAGE_CENTOS
else
ok "$PACKAGE_CENTOS is absent"
fi

View File

@ -42,8 +42,7 @@ apply () {
is_pkg_installed $PACKAGE
if [ $FNRET = 0 ]; then
warn "$PACKAGE is installed, purging"
apt-get purge $PACKAGE -y
apt-get autoremove
uninstall_pkg $PACKAGE
else
ok "$PACKAGE is absent"
fi

View File

@ -69,8 +69,7 @@ apply_debian () {
is_pkg_installed $PACKAGE
if [ $FNRET = 0 ]; then
crit "$PACKAGE is installed, purging it"
apt-get purge $PACKAGE -y
apt-get autoremove
uninstall_pkg $PACKAGE
else
ok "$PACKAGE is absent"
fi
@ -97,7 +96,7 @@ apply_centos () {
is_pkg_installed $PACKAGE
if [ $FNRET = 0 ]; then
crit "$PACKAGE is installed, purging it"
yum remove $PACKAGE -y
uninstall_pkg $PACKAGE
else
ok "$PACKAGE is absent"
fi

View File

@ -41,12 +41,7 @@ apply () {
is_pkg_installed $PACKAGE
if [ $FNRET = 0 ]; then
warn "$PACKAGE is installed, purging"
if [ $OS_RELEASE -eq 2 ]; then
yum remove $PACKAGE -y
else
apt-get purge $PACKAGE -y
apt-get autoremove
fi
uninstall_pkg $PACKAGE
else
ok "$PACKAGE is absent"
fi

View File

@ -68,8 +68,7 @@ apply_debian () {
is_pkg_installed $PACKAGE
if [ $FNRET = 0 ]; then
crit "$PACKAGE is installed, purging it"
apt-get purge $PACKAGE -y
apt-get autoremove
uninstall_pkg $PACKAGE
else
ok "$PACKAGE is absent"
fi
@ -95,7 +94,7 @@ apply_centos () {
is_pkg_installed $PACKAGE_CENTOS
if [ $FNRET = 0 ]; then
crit "$PACKAGE_CENTOS is installed, purging it"
yum remove $PACKAGE_CENTOS -y
uninstall_pkg $PACKAGE_CENTOS
else
ok "$PACKAGE_CENTOS is absent"
fi

View File

@ -41,12 +41,7 @@ apply () {
is_pkg_installed $PACKAGE
if [ $FNRET = 0 ]; then
warn "$PACKAGE is installed, purging"
if [ $OS_RELEASE -eq 2 ]; then
yum remove $PACKAGE -y
else
apt-get purge $PACKAGE -y
apt-get autoremove
fi
uninstall_pkg $PACKAGE
else
ok "$PACKAGE is absent"
fi

View File

@ -50,12 +50,7 @@ apply () {
warn "$PACKAGE is installed! But the exception is set to true, so don't need any operate."
else
crit "$PACKAGE is installed, purging it"
if [ $OS_RELEASE -eq 2 ]; then
yum autoremove $PACKAGE
else
apt-get purge $PACKAGE
apt-get autoremove
fi
uninstall_pkg $PACKAGE
fi
else
ok "$PACKAGE is absent"

View File

@ -49,8 +49,7 @@ apply () {
warn "$PACKAGE is installed! But the exception is set to true, so don't need any operate."
else
crit "$PACKAGE is installed, purging it"
apt-get purge $PACKAGE -y
apt-get autoremove
uninstall_pkg $PACKAGE
fi
else
ok "$PACKAGE is absent"

View File

@ -49,12 +49,7 @@ apply () {
warn "$PACKAGE is installed! But the exception is set to true, so don't need any operate."
else
crit "$PACKAGE is installed, purging it"
if [ $OS_RELEASE -eq 2 ]; then
yum autoremove $PACKAGE -y
else
apt-get purge $PACKAGE -y
apt-get autoremove
fi
uninstall_pkg $PACKAGE
fi
else
ok "$PACKAGE is absent"

View File

@ -36,8 +36,7 @@ apply () {
is_pkg_installed $PACKAGE
if [ $FNRET = 0 ]; then
crit "$PACKAGE is installed, purging it"
apt-get purge $PACKAGE -y
apt-get autoremove
uninstall_pkg $PACKAGE
else
ok "$PACKAGE is absent"
fi

View File

@ -49,12 +49,7 @@ apply () {
warn "$PACKAGE is installed! But the exception is set to true, so don't need any operate."
else
crit "$PACKAGE is installed, purging it"
if [ $OS_RELEASE -eq 2 ]; then
yum autoremove $PACKAGE -y
else
apt-get purge $PACKAGE -y
apt-get autoremove
fi
uninstall_pkg $PACKAGE
fi
else
ok "$PACKAGE is absent"

View File

@ -49,12 +49,7 @@ apply () {
warn "$PACKAGE is installed! But the exception is set to true, so don't need any operate."
else
crit "$PACKAGE is installed, purging it"
if [ $OS_RELEASE -eq 2 ]; then
yum autoremove $PACKAGE -y
else
apt-get purge $PACKAGE -y
apt-get autoremove
fi
uninstall_pkg $PACKAGE
fi
else
ok "$PACKAGE is absent"

View File

@ -49,12 +49,7 @@ apply () {
warn "$PACKAGE is installed! But the exception is set to true, so don't need any operate."
else
crit "$PACKAGE is installed, purging it"
if [ $OS_RELEASE -eq 2 ]; then
yum autoremove $PACKAGE -y
else
apt-get purge $PACKAGE -y
apt-get autoremove
fi
uninstall_pkg $PACKAGE
fi
else
ok "$PACKAGE is absent"

View File

@ -49,8 +49,7 @@ apply () {
warn "$PACKAGE is installed! But the exception is set to true, so don't need any operate."
else
crit "$PACKAGE is installed, purging it"
apt-get purge $PACKAGE -y
apt-get autoremove
uninstall_pkg $PACKAGE
fi
else
ok "$PACKAGE is absent"

View File

@ -49,12 +49,7 @@ apply () {
warn "$PACKAGE is installed! But the exception is set to true, so don't need any operate."
else
crit "$PACKAGE is installed, purging it"
if [ $OS_RELEASE -eq 2 ]; then
yum autoremove $PACKAGE -y
else
apt-get purge $PACKAGE -y
apt-get autoremove
fi
uninstall_pkg $PACKAGE
fi
else
ok "$PACKAGE is absent"

View File

@ -50,12 +50,7 @@ apply () {
warn "$PACKAGE is installed! But the exception is set to true, so don't need any operate."
else
crit "$PACKAGE is installed, purging it"
if [ $OS_RELEASE -eq 2 ]; then
yum autoremove $PACKAGE -y
else
apt-get purge $PACKAGE -y
apt-get autoremove
fi
uninstall_pkg $PACKAGE
fi
else
ok "$PACKAGE is absent"