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.
144 lines
4.1 KiB
144 lines
4.1 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_goldsourceconfig(){
|
|
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}"
|
|
echo "creating listip.cfg."
|
|
sleep 1
|
|
touch "${systemdir}/listip.cfg"
|
|
echo "creating banned.cfg."
|
|
touch "${systemdir}/banned.cfg"
|
|
sleep 1
|
|
if [ -z "${autoinstall}" ]; then
|
|
echo ""
|
|
echo "Configuring ${gamename} Server"
|
|
echo "================================="
|
|
sleep 1
|
|
read -p "Enter server name: " servername
|
|
read -p "Enter rcon password: " rconpass
|
|
else
|
|
servername="${servicename}"
|
|
rconpass="rconpassword"
|
|
fi
|
|
sed -i "s/\"hostname\"/\"${servername}\"/g" "${servercfgfullpath}"
|
|
sed -i "s/\"rconpassword\"/\"${rconpass}\"/g" "${servercfgfullpath}"
|
|
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
|
|
if [ -z "${autoinstall}" ]; then
|
|
echo ""
|
|
echo "Configuring ${gamename} Server"
|
|
echo "================================="
|
|
sleep 1
|
|
read -p "Enter server name: " servername
|
|
read -p "Enter rcon password: " rconpass
|
|
else
|
|
servername="${servicename}"
|
|
rconpass="rconpassword"
|
|
fi
|
|
sed -i "s/\"hostname\"/\"${servername}\"/g" "${servercfgfullpath}"
|
|
sed -i "s/\"rconpassword\"/\"${rconpass}\"/g" "${servercfgfullpath}"
|
|
echo ""
|
|
}
|
|
|
|
fn_ut2k4config(){
|
|
echo ""
|
|
echo "Loading Configs"
|
|
echo "================================="
|
|
sleep 1
|
|
cp -v "${defaultcfg}" "${systemdir}/${ini}"
|
|
sleep 1
|
|
echo ""
|
|
echo "Configuring ${gamename} Server"
|
|
echo "================================="
|
|
sleep 1
|
|
echo "Setting WebAdmin username and password"
|
|
sed -i 's/AdminName=/AdminName=admin/g' "${systemdir}/${ini}"
|
|
sed -i 's/AdminPassword=/AdminPassword=admin/g' "${systemdir}/${ini}"
|
|
sleep 1
|
|
echo "Enabling WebAdmin"
|
|
sed -i 's/bEnabled=False/bEnabled=True/g' "${systemdir}/${ini}"
|
|
sleep 1
|
|
echo "Setting WebAdmin port to 8077"
|
|
sed -i 's/ListenPort=80/ListenPort=8077/g' "${systemdir}/${ini}"
|
|
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}" == "Blade Symphony" ]; then
|
|
wget --no-check-certificate -nv -N https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/BladeSymphony/cfg/lgsm-default.cfg
|
|
fn_goldsourceconfig
|
|
elif [ "${gamename}" == "Counter Strike 1.6" ]; then
|
|
wget --no-check-certificate -nv -N https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/CounterStrike/cfg/lgsm-default.cfg
|
|
fn_goldsourceconfig
|
|
elif [ "${gamename}" == "Counter Strike: Condition Zero" ]; then
|
|
wget --no-check-certificate -nv -N https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/CounterStrikeConditionZero/cfg/lgsm-default.cfg
|
|
fn_goldsourceconfig
|
|
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
|
|
elif [ "${gamename}" == "Just Cause 2" ]; then
|
|
echo "lgsm-default.cfg not required."
|
|
fn_jc2config
|
|
elif [ "${gamename}" == "Unreal Tournament 2004" ]; then
|
|
echo "lgsm-default.cfg not required."
|
|
fn_ut2k4config
|
|
fi
|