lgsm local mirror
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

49 lines
1.6 KiB

#!/bin/bash
# LGSM install_dst_token.sh function
# Author: Daniel Gibbs & Marvin Lehmann (marvinl97)
# Website: https://gameservermanagers.com
# Description: Configures Don't Starve Together cluster with given token.
local commandname="INSTALL"
local commandaction="Install"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
echo ""
echo "Enter ${gamename} Cluster Token"
echo "================================="
sleep 1
echo "A cluster token is required to run this server!"
echo "Follow the instructions in this link to obtain this key:"
echo "https://gameservermanagers.com/dst-auth-token"
echo ""
if [ -z "${autoinstall}" ]; then
overwritetoken="true"
if [ -s "${clustercfgdir}/cluster_token.txt" ]; then
echo "The cluster token is already set. Do you want to overwrite it?"
fn_script_log_info "Don't Starve Together cluster token is already set"
while true; do
read -e -i "n" -p "Continue? [Y/n]" yn
case $yn in
[Yy]* ) overwritetoken="true"; break;;
[Nn]* ) overwritetoken="false"; break;;
* ) echo "Please answer yes or no.";;
esac
done
fi
if [ "${overwritetoken}" == "true" ]; then
echo "Once you have the cluster token, enter it below"
echo -n "Cluster Token: "
read token
mkdir -pv "${clustercfgdir}"
echo "${token}" > "${clustercfgdir}/cluster_token.txt"
if [ -f "${clustercfgdir}/cluster_token.txt" ]; then
echo "Don't Starve Together cluster token created"
fn_script_log_info "Don't Starve Together cluster token created"
fi
unset overwritetoken
fi
else
echo "You can add your cluster token using the following command"
echo "./${selfname} cluster-token"
fi
echo ""