From cbcf73ff687abf0361d42c907c9fae7e8974ed28 Mon Sep 17 00:00:00 2001 From: Ben Peddell Date: Tue, 16 Feb 2016 13:47:06 +1000 Subject: [PATCH] Add uninstallmod and reinstallmod --- tools/arkmanager | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tools/arkmanager b/tools/arkmanager index a1be1f4..cc75360 100755 --- a/tools/arkmanager +++ b/tools/arkmanager @@ -1382,6 +1382,17 @@ doInstallMod(){ fi } +# +# Removes mod from mods directory +# +doUninstallMod(){ + local modid=$1 + local moddir="$arkserverroot/ShooterGame/Content/Mods/$modid" + if [ -d "${moddir}" ]; then + rm -rf "${moddir}" + fi +} + # # Copies server state to a backup directory # @@ -1659,6 +1670,8 @@ showUsage() { echo "checkupdate Check for a new ARK server version" echo "install Install the ARK server files from steamcmd" echo "installmod Installs a mod from the Steam workshop" + echo "uninstallmod Removes the mod from the Mods directory" + echo "reinstallmod Removes and re-installs a mod in the Mods directory" echo "restart Stops the server and then starts it" echo "run Runs the server without daemonizing" echo "start Starts the server" @@ -1697,6 +1710,8 @@ while true; do # get the number of arguments for commands that take arguments case "$command" in installmod) nrarg=1; ;; + uninstallmod) nrarg=1; ;; + reinstallmod) nrarg=1; ;; broadcast) nrarg=1; ;; rconcmd) nrarg=1; ;; useconfig) nrarg=1; ;; @@ -1833,6 +1848,13 @@ while true; do installmod) doInstallMod "${args[@]}" ;; + uninstallmod) + doUninstallMod "${args[@]}" + ;; + reinstallmod) + doUninstallMod "${args[@]}" + doInstallMod "${args[@]}" + ;; backup) doBackup ;;