dayzdockerserver/files/manage
Daniel Ceregatti d87c5fad0e Create a dedicated means by which we can run interactive prompts to effect tasks such as (all WIP):
Logging into to Steam, accounting for Steam Guard. These credentials persist throughout the lifetime of the docker volume storing the data.
  Adding/removing/managing workshop items. The goal is to also manage the "=mod=" parameter.
  Listing the auto-generated RCON password.
  Backing up.
Further refine the original dayzserver script. In docker, a lot of the other stuff wasn't necessary so a lot is just being removed.
Install steamcmd into the container in Dockerfile and adjust paths.
Vastly updated docs!
2022-03-26 13:02:54 -07:00

39 lines
924 B
Bash
Executable file

#!/usr/bin/env bash
if [[ "${1}" = "login" ]]
then
if [ -f ${HOME}/.steamlogin ]
then
echo -n "The steam login is already set. Reset it? (Y|n): "
read -s -n 1 a
a=$(echo ${a} | tr A-Z a-z)
if [[ "${a}" = "y" ]]
then
rm -f ${HOME}/.steamlogin
else
echo "Not reset. Nothing to do. Exiting..."
exit 0
fi
fi
if [ ! -f ${HOME}/.steamlogin ]
then
echo "Setting up Steam credentials"
cp /files/steamlogin "${HOME}/.steamlogin"
source "${HOME}/.steamlogin"
steamcmd.sh +force_install_dir ${HOME}/serverfiles +login "${steamlogin}" +quit
fi
elif [[ "${1}" = "workshop" ]]
then
echo "Updating workshopp..."
elif [[ "${1}" = "backup" ]]
then
echo "Creating backup..."
elif [[ "${1}" = "rconpassword" ]]
then
echo "The RCON password is: ..."
else
echo "Unknown option '${1}'"
echo "Usage: manage backup | login | workshop | rconpassword"
exit 0
fi