#!/bin/bash # Setup game server if [ ! -f "${GAMESERVER}" ]; then echo -e "" echo -e "creating ${GAMESERVER}" echo -e "=================================" ./linuxgsm.sh "${GAMESERVER}" fi # Clear modules directory if not master if [ "${LGSM_GITHUBBRANCH}" != "master" ]; then echo -e "not master branch, clearing modules directory" rm -rf /app/lgsm/modules/* elif [ -d "/app/lgsm/modules" ]; then echo -e "ensure all modules are executable" chmod +x /app/lgsm/modules/* fi # Install game server if [ -z "$(ls -A -- "serverfiles" 2> /dev/null)" ]; then echo -e "" echo -e "Installing ${GAMESERVER}" echo -e "=================================" ./"${GAMESERVER}" auto-install install=1 else # Sponsor to display LinuxGSM logo ./"${GAMESERVER}" sponsor fi echo -e "" echo -e "Starting Update Checks" echo -e "=================================" nohup watch -n "${UPDATE_CHECK}" ./"${GAMESERVER}" update > /dev/null 2>&1 & echo -e "update will check every ${UPDATE_CHECK} minutes" # Update game server if [ -z "${install}" ]; then echo -e "" echo -e "Checking for Update ${GAMESERVER}" echo -e "=================================" ./"${GAMESERVER}" update fi echo -e "" echo -e "Starting ${GAMESERVER}" echo -e "=================================" ./"${GAMESERVER}" start sleep 5 ./"${GAMESERVER}" details sleep 2 echo -e "Tail log files" echo -e "=================================" tail -F log/*/*.log