Add uninstall-tools command to arkmanager

This commit is contained in:
Ben Peddell 2015-09-18 19:58:15 +10:00
parent 0a09613c3e
commit ee32f7c86a

View File

@ -1015,6 +1015,25 @@ doUpgrade() {
fi 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() { useConfig() {
for varname in "${!configfile_@}"; do for varname in "${!configfile_@}"; do
if [ "configfile_$1" == "$varname" ]; then if [ "configfile_$1" == "$varname" ]; then
@ -1107,6 +1126,9 @@ while true; do
upgrade-tools) upgrade-tools)
doUpgrade doUpgrade
;; ;;
uninstall-tools)
doUninstallTools
;;
useconfig) useconfig)
useConfig "$2" useConfig "$2"
shift shift
@ -1135,6 +1157,7 @@ while true; do
echo "update --validate Validates all ARK server files" echo "update --validate Validates all ARK server files"
echo "update --update-mods Updates installed and requested mods" 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 "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 <name> Use the configuration overrides in the specified config name or file" echo "useconfig <name> Use the configuration overrides in the specified config name or file"
exit 1 exit 1
;; ;;