103 changed files with 2620 additions and 816 deletions
@ -4,7 +4,7 @@ |
|||||
# Author: Daniel Gibbs |
# Author: Daniel Gibbs |
||||
# Contributions: Bryce Van Dyk (SingingTree) |
# Contributions: Bryce Van Dyk (SingingTree) |
||||
# Website: http://gameservermanagers.com |
# Website: http://gameservermanagers.com |
||||
version="031015" |
version="121215" |
||||
|
|
||||
#### Variables #### |
#### Variables #### |
||||
|
|
||||
@ -14,7 +14,7 @@ emailnotification="off" |
|||||
email="[email protected]" |
email="[email protected]" |
||||
|
|
||||
# Steam login |
# Steam login |
||||
steamuser="username" |
steamuser="anonymous" |
||||
steampass="password" |
steampass="password" |
||||
|
|
||||
# Start Variables |
# Start Variables |
||||
@ -27,6 +27,13 @@ parms="" |
|||||
|
|
||||
#### Advanced Variables #### |
#### Advanced Variables #### |
||||
|
|
||||
|
# Github Branch Select |
||||
|
# Allows for the use of different function files |
||||
|
# from a different repo and/or branch. |
||||
|
githubuser="dgibbs64" |
||||
|
githubrepo="linuxgsm" |
||||
|
githubbranch="master" |
||||
|
|
||||
# Steam |
# Steam |
||||
appid="380870" |
appid="380870" |
||||
|
|
||||
@ -36,8 +43,8 @@ gamename="Project Zomboid" |
|||||
engine="projectzomboid" |
engine="projectzomboid" |
||||
|
|
||||
# Directories |
# Directories |
||||
rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" |
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))" |
||||
selfname="$(basename $0)" |
selfname=$(basename $(readlink -f "${BASH_SOURCE[0]}")) |
||||
lockselfname=".${servicename}.lock" |
lockselfname=".${servicename}.lock" |
||||
filesdir="${rootdir}/serverfiles" |
filesdir="${rootdir}/serverfiles" |
||||
systemdir="${filesdir}" |
systemdir="${filesdir}" |
||||
@ -64,20 +71,45 @@ consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M- |
|||||
##### Script ##### |
##### Script ##### |
||||
# Do not edit |
# Do not edit |
||||
|
|
||||
fn_runfunction(){ |
fn_getgithubfile(){ |
||||
# Functions are downloaded and run with this function |
filename=$1 |
||||
if [ ! -f "${rootdir}/functions/${functionfile}" ]; then |
exec=$2 |
||||
cd "${rootdir}" |
fileurl=${3:-$filename} |
||||
if [ ! -d "functions" ]; then |
filepath="${rootdir}/${filename}" |
||||
mkdir functions |
filedir=$(dirname "${filepath}") |
||||
|
# If the function file is missing, then download |
||||
|
if [ ! -f "${filepath}" ]; then |
||||
|
if [ ! -d "${filedir}" ]; then |
||||
|
mkdir "${filedir}" |
||||
fi |
fi |
||||
cd functions |
githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${fileurl}" |
||||
echo -e " loading ${functionfile}...\c" |
echo -e " fetching ${filename}...\c" |
||||
wget -N /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgsm/master/functions/${functionfile} 2>&1 | grep -F HTTP | cut -c45- |
if [ "$(command -v curl)" ]||[ "$(which curl >/dev/null 2>&1)" ]||[ -f "/usr/bin/curl" ]||[ -f "/bin/curl" ]; then |
||||
chmod +x "${functionfile}" |
echo -e "\e[0;31mFAIL\e[0m\n" |
||||
cd "${rootdir}" |
echo "Curl is not installed!" |
||||
|
echo -e "" |
||||
|
exit |
||||
|
fi |
||||
|
CURL=$(curl --fail -o "${filepath}" "${githuburl}" 2>&1) |
||||
|
if [ $? -ne 0 ]; then |
||||
|
echo -e "\e[0;31mFAIL\e[0m\n" |
||||
|
echo " $CURL"|grep "curl:" |
||||
|
echo -e "${githuburl}\n" |
||||
|
exit |
||||
|
else |
||||
|
echo -e "\e[0;32mOK\e[0m" |
||||
|
fi |
||||
|
if [ "${exec}" ]; then |
||||
|
chmod +x "${filepath}" |
||||
|
fi |
||||
|
fi |
||||
|
if [ "${exec}" ]; then |
||||
|
source "${filepath}" |
||||
fi |
fi |
||||
source "${rootdir}/functions/${functionfile}" |
} |
||||
|
|
||||
|
fn_runfunction(){ |
||||
|
fn_getgithubfile "functions/${functionfile}" 1 |
||||
} |
} |
||||
|
|
||||
fn_functions(){ |
fn_functions(){ |
||||
|
|||||
@ -0,0 +1,42 @@ |
|||||
|
#!/bin/bash |
||||
|
# LGSM fn_install_gslt function |
||||
|
# Author: Daniel Gibbs |
||||
|
# Website: http://gameservermanagers.com |
||||
|
lgsm_version="091215" |
||||
|
|
||||
|
# Description: Configures GSLT. |
||||
|
|
||||
|
if [ -z "${autoinstall}" ]; then |
||||
|
echo "" |
||||
|
echo "Game Server Login Token" |
||||
|
echo "============================" |
||||
|
sleep 1 |
||||
|
if [ "${gamename}" == "Counter Strike: Global Offensive" ]; then |
||||
|
echo "GSLT is required to run a public ${gamename} server" |
||||
|
else |
||||
|
echo "GSLT is an optional feature for ${gamename} server" |
||||
|
fi |
||||
|
|
||||
|
echo "Get more info and a token here:" |
||||
|
echo "http://gameservermanagers.com/gslt" |
||||
|
echo "" |
||||
|
echo "Enter token below (Can be blank)." |
||||
|
echo -n "GSLT TOKEN: " |
||||
|
read token |
||||
|
sed -i -e "s/gslt=\"\"/gslt=\"${token}\"/g" "${rootdir}/${selfname}" |
||||
|
sleep 1 |
||||
|
echo "The GSLT can be changed by editing ${selfname}." |
||||
|
echo "" |
||||
|
else |
||||
|
if [ "${gamename}" == "Counter Strike: Global Offensive" ]; then |
||||
|
fn_printinfomationnl "GSLT is required to run a public ${gamename} server" |
||||
|
else |
||||
|
fn_printinfomationnl "GSLT is an optional feature for ${gamename} server" |
||||
|
fi |
||||
|
echo "Get more info and a token here:" |
||||
|
echo "http://gameservermanagers.com/gslt" |
||||
|
echo "" |
||||
|
sleep 1 |
||||
|
echo "The GSLT can be changed by editing ${selfname}." |
||||
|
sleep 1 |
||||
|
fi |
||||
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue