我是 Linux 新手。几天前我在 ubuntu 19.10 上安装了 mailarchiva,结果发现 Google 上找不到任何卸载说明。在 mailarchiva 安装文件夹中,有一个名为的文本文件,上面uninstall
写着我应该运行这个 bash 脚本,但我不知道如何运行 bash 脚本。
有人试过这个吗?它只会删除 mailarchiva 而保留其他所有内容吗?
#!/bin/bash
# MailArchiva Enterprise Edition Uninstall Script
# Copyright (c) 2005-2009 Jamie Band
# Visit http://www.mailarchiva.com for more information on this product
# change below with caution!
# the contents of MAILARCHIVA_HOME will be deleted
WEBAPPNAME=ROOT
MAILARCHIVA_HOME=/opt/mailarchiva
SERVER=$MAILARCHIVA_HOME/server
CATALINA_BASE=/var/opt/mailarchiva/tomcat
WEBAPP=$CATALINA_BASE/webapps/$WEBAPPNAME
AUTOUPDATE=$CATALINA_BASE/update/autoupdate
echo MailArchiva Uninstall
if [ `id -u` != "0" ]; then
echo "Sorry, you are not root."
exit 1
fi
echo -n "Are you sure you wish to uninstall MailArchiva (yes/no)? "
read proceed
if [ "$proceed" == "yes" ]; then
$SERVER/stopserver 2>/dev/null
mkdir ./backup 2>/dev/null
$SERVER/uninstallservice 2>/dev/null
rm -rf $MAILARCHIVA_HOME
rm -rf $WEBAPP
rm -rf $AUTOUPDATE
rm -rf $CATALINA_BASE/work
rm -rf $CATALINA_BASE/logs
echo MailArchiva is uninstalled.
echo FYI: If you experienced problems, please report to
[email protected]
else
echo "aborted."
fi
答案1
根据您发布的内容,此脚本应该可以完成您要查找的操作。从终端,在脚本所在的目录中,运行以下命令:
sudo ./uninstall