gameservergame-servergame-servershacktoberfestdedicated-game-serversgamelinuxgsmserverbashgaminglinuxmultiplayer-game-servershell
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.
73 lines
1.8 KiB
73 lines
1.8 KiB
#!/bin/bash
|
|
# LGSM fn_serverconfig function
|
|
# Author: Daniel Gibbs
|
|
# Website: http://danielgibbs.co.uk
|
|
# Version: 011214
|
|
|
|
fn_arma3config(){
|
|
echo ""
|
|
echo "Loading Configs"
|
|
echo "================================="
|
|
sleep 1
|
|
cp -v lgsm-default.cfg "${servercfgfullpath}"
|
|
sleep 1
|
|
echo ""
|
|
}
|
|
|
|
fn_jc2config(){
|
|
echo ""
|
|
echo "Loading Configs"
|
|
echo "================================="
|
|
sleep 1
|
|
cd "${filesdir}"
|
|
cp -v default_config.lua config.lua
|
|
sleep 1
|
|
echo ""
|
|
}
|
|
|
|
fn_sourceconfig(){
|
|
echo ""
|
|
echo "Loading Configs"
|
|
echo "================================="
|
|
sleep 1
|
|
echo "creating ${servicename}.cfg config file."
|
|
cp -v lgsm-default.cfg "${servercfgfullpath}"
|
|
sleep 1
|
|
echo "creating server.cfg."
|
|
touch "${defaultcfg}"
|
|
sleep 1
|
|
echo "creating redirect."
|
|
echo "server.cfg > ${servercfg}."
|
|
echo "exec ${servercfg}" > "${defaultcfg}"
|
|
sleep 1
|
|
echo ""
|
|
echo "Configuring ${gamename} Server"
|
|
echo "================================="
|
|
sleep 1
|
|
if [ -z "${autoinstall}" ]; then
|
|
read -p "Enter server name: " servername
|
|
read -p "Enter rcon password: " rconpass
|
|
else
|
|
servername="${servicename}"
|
|
rconpass="${rconpass}"
|
|
fi
|
|
sed -i "s/\"hostname\"/\"${servername}\"/g" "${servercfgfullpath}"
|
|
sed -i "s/\"rconpassword\"/\"${rconpass}\"/g" "${servercfgfullpath}"
|
|
echo ""
|
|
}
|
|
|
|
|
|
echo "Downloading lgsm-default.cfg"
|
|
echo "================================="
|
|
sleep 1
|
|
cd "${servercfgdir}"
|
|
if [ "${gamename}" == "ARMA 3" ]; then
|
|
wget --no-check-certificate -nv -N https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/Arma3/cfg/lgsm-default.cfg
|
|
fn_arma3config
|
|
elif [ "${gamename}" == "Just Cause 2" ]; then
|
|
echo "lgsm-default.cfg not required"
|
|
fn_jc2config
|
|
elif [ "${gamename}" == "Counter Strike: Source" ]; then
|
|
wget --no-check-certificate -nv -N https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/CounterStrikeSource/cfg/lgsm-default.cfg
|
|
fn_sourceconfig
|
|
fi
|