mirror of
https://github.com/eliasstepanik/ark-ac-server-tools.git
synced 2026-01-18 13:18:26 +00:00
Allow multiple mods to be installed or uninstalled
This commit is contained in:
parent
a46ef5ad23
commit
ac56f438f1
@ -230,15 +230,18 @@ instances.
|
||||
Installs all mods specified in the instance config into the
|
||||
`ShooterGame/Content/Mods` directory
|
||||
|
||||
`installmod <modnum>`::
|
||||
Installs the specified mod into the `ShooterGame/Content/Mods`
|
||||
`installmod <modnum>[,<modnum>[,...]]`::
|
||||
Installs the specified mods into the `ShooterGame/Content/Mods`
|
||||
directory
|
||||
|
||||
`uninstallmod <modnum>`::
|
||||
Deletes the specified mod from the `ShooterGame/Content/Mods`
|
||||
`uninstallmod <modnum>[,<modnum>[,...]]`::
|
||||
Deletes the specified mods from the `ShooterGame/Content/Mods`
|
||||
directory
|
||||
|
||||
`reinstallmod <modnum>`::
|
||||
`removemod <modnum>[,<modnum>[,...]]`::
|
||||
Deletes the specified mods from the SteamCMD workshop directory
|
||||
|
||||
`reinstallmod <modnum>[,<modnum>[,...]]`::
|
||||
Runs the `uninstallmod` command followed by the `installmod`
|
||||
command
|
||||
|
||||
|
||||
@ -1861,16 +1861,17 @@ doExtractMod(){
|
||||
# Downloads mod and installs it into mods directory
|
||||
#
|
||||
doInstallMod(){
|
||||
local modid=$1
|
||||
local modid
|
||||
for modid in "${1//,/ }"; do
|
||||
if [ -f "$steamcmdroot/steamapps/workshop/appworkshop_${mod_appid}.acf" ]; then
|
||||
sed -i "/^\\t\\t\"${modid}\"/,/^\\t\\t}/d" "$steamcmdroot/steamapps/workshop/appworkshop_${mod_appid}.acf"
|
||||
fi
|
||||
|
||||
if [ -f "$steamcmdroot/steamapps/workshop/appworkshop_${mod_appid}.acf" ]; then
|
||||
sed -i "/^\\t\\t\"${modid}\"/,/^\\t\\t}/d" "$steamcmdroot/steamapps/workshop/appworkshop_${mod_appid}.acf"
|
||||
fi
|
||||
|
||||
if doDownloadMod $modid; then
|
||||
doExtractMod $modid
|
||||
echo "Mod $modid installed"
|
||||
fi
|
||||
if doDownloadMod $modid; then
|
||||
doExtractMod $modid
|
||||
echo "Mod $modid installed"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
#
|
||||
@ -1886,11 +1887,13 @@ doInstallAllMods(){
|
||||
# Removes mod from mods directory
|
||||
#
|
||||
doUninstallMod(){
|
||||
local modid=$1
|
||||
local moddir="$arkserverroot/ShooterGame/Content/Mods/$modid"
|
||||
if [ -d "${moddir}" ]; then
|
||||
rm -rf "${moddir}"
|
||||
fi
|
||||
local modid
|
||||
for modid in "${1//,/ }"; do
|
||||
local moddir="$arkserverroot/ShooterGame/Content/Mods/$modid"
|
||||
if [ -d "${moddir}" ]; then
|
||||
rm -rf "${moddir}"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
#
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user