From ee32f7c86a35146d1ff7d1a6300b6c5ab24974b7 Mon Sep 17 00:00:00 2001 From: Ben Peddell Date: Fri, 18 Sep 2015 19:58:15 +1000 Subject: [PATCH] Add uninstall-tools command to arkmanager --- tools/arkmanager | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/tools/arkmanager b/tools/arkmanager index 5d8ac61..f3d90ab 100755 --- a/tools/arkmanager +++ b/tools/arkmanager @@ -1015,6 +1015,25 @@ doUpgrade() { fi } +doUninstallTools() { + local sudo=sudo + if [ "$steamcmd_user" == "--me" ]; then + sudo= + fi + + read -p "Are you sure you want to uninstall the ARK Server Tools?" -n 1 -r + + if [[ "$REPLY" =~ ^[Yy]$ ]]; then + if [ -n "${install_datadir}" -a -x "${install_datadir}/arkmanager-uninstall.sh" ]; then + $sudo "${install_datadir}/arkmanager-uninstall.sh" + exit 0 + elif [ -n "${install_libexecdir}" -a -x "${install_libexecdir}/arkmanager-uninstall.sh" ]; then + $sudo "${install_libexecdir}/arkmanager-uninstall.sh" + exit 0 + fi + fi +} + useConfig() { for varname in "${!configfile_@}"; do if [ "configfile_$1" == "$varname" ]; then @@ -1107,6 +1126,9 @@ while true; do upgrade-tools) doUpgrade ;; + uninstall-tools) + doUninstallTools + ;; useconfig) useConfig "$2" shift @@ -1135,6 +1157,7 @@ while true; do echo "update --validate Validates all ARK server files" echo "update --update-mods Updates installed and requested mods" echo "upgrade-tools Check for a new ARK Server Tools version and upgrades it if needed" + echo "uninstall-tools Uninstall the ARK Server Tools" echo "useconfig Use the configuration overrides in the specified config name or file" exit 1 ;;