| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254 |
- #!/bin/bash
- # LGSM fn_server function
- # Author: Daniel Gibbs
- # Website: http://danielgibbs.co.uk
- # Version: 200315
- fn_arma3config(){
- mkdir -pv "${servercfgdir}"
- mv -v lgsm-default.server.cfg "${servercfgfullpath}"
- mv -v lgsm-default.network.cfg "${networkcfgfullpath}"
- sleep 1
- echo ""
- }
- fn_goldsourceconfig(){
- 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(){
- cd "${filesdir}"
- cp -v default_config.lua config.lua
- sleep 1
- echo ""
- }
- fn_serious3config(){
- cp -v lgsm-default.ini ${servercfg}
- sleep 1
- echo ""
- }
- fn_sourceconfig(){
- 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_ut99config(){
- echo "${defaultcfg} > ${servercfgfullpath}"
- tr -d '\r' < "${defaultcfg}" > "${servercfgfullpath}"
- sleep 1
- echo ""
- echo "Configuring ${gamename} Server"
- echo "================================="
- sleep 1
- echo "enabling WebAdmin."
- sed -i 's/bEnabled=False/bEnabled=True/g' "${servercfgfullpath}"
- sleep 1
- echo "setting WebAdmin port to 8076."
- sed -i '467i\ListenPort=8076' "${servercfgfullpath}"
- sleep 1
- echo ""
- }
- fn_unity3dconfig(){
- cp -v serverconfig.xml ${servercfg}
- sleep 1
- echo ""
- }
- fn_unreal2config(){
- cp -v "${defaultcfg}" "${servercfgfullpath}"
- sleep 1
- echo ""
- echo "Configuring ${gamename} Server"
- echo "================================="
- sleep 1
- echo "setting WebAdmin username and password."
- sed -i 's/AdminName=/AdminName=admin/g' "${servercfgfullpath}"
- sed -i 's/AdminPassword=/AdminPassword=admin/g' "${servercfgfullpath}"
- sleep 1
- echo "enabling WebAdmin."
- sed -i 's/bEnabled=False/bEnabled=True/g' "${servercfgfullpath}"
- if [ "${gamename}" == "Unreal Tournament 2004" ]; then
- sleep 1
- echo "setting WebAdmin port to 8075."
- sed -i 's/ListenPort=80/ListenPort=8075/g' "${servercfgfullpath}"
- fi
- sleep 1
- echo ""
- }
- echo ""
- echo "Creating Configs"
- echo "================================="
- sleep 1
- if [ "${gamename}" == "ARMA 3" ]; then
- cd "${systemdir}"
- else
- cd "${servercfgdir}"
- fi
- #statements
- if [ "${gamename}" == "7 Days To Die" ]; then
- fn_unity3dconfig
- elif [ "${gamename}" == "ARMA 3" ]; then
- echo -e "downloading lgsm-default.server.cfg & lgsm-default.network.cfg...\c"
- wget -N --no-check-certificate /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/Arma3/cfg/lgsm-default.server.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq
- wget -N --no-check-certificate /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/Arma3/cfg/lgsm-default.network.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq
- sleep 1
- fn_arma3config
- elif [ "${gamename}" == "Blade Symphony" ]; then
- echo -e "downloading lgsm-default.cfg...\c"
- wget -N --no-check-certificate /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/BladeSymphony/cfg/lgsm-default.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq
- sleep 1
- fn_goldsourceconfig
- elif [ "${gamename}" == "Counter Strike 1.6" ]; then
- echo -e "downloading lgsm-default.cfg...\c"
- wget -N --no-check-certificate /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/CounterStrike/cfg/lgsm-default.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq
- sleep 1
- fn_goldsourceconfig
- elif [ "${gamename}" == "Counter Strike: Condition Zero" ]; then
- echo -e "downloading lgsm-default.cfg...\c"
- wget -N --no-check-certificate /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/CounterStrikeConditionZero/cfg/lgsm-default.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq
- sleep 1
- fn_goldsourceconfig
- elif [ "${gamename}" == "Counter Strike: Global Offensive" ]; then
- echo -e "downloading lgsm-default.cfg...\c"
- wget -N --no-check-certificate /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/CounterStrikeGlobalOffensive/cfg/lgsm-default.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq
- sleep 1
- fn_sourceconfig
- elif [ "${gamename}" == "Counter Strike: Source" ]; then
- echo -e "downloading lgsm-default.cfg...\c"
- wget -N --no-check-certificate /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/CounterStrikeSource/cfg/lgsm-default.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq
- sleep 1
- fn_sourceconfig
- elif [ "${gamename}" == "Day of Defeat" ]; then
- echo -e "downloading lgsm-default.cfg...\c"
- wget -N --no-check-certificate /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/DayOfDefeat/cfg/lgsm-default.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq
- sleep 1
- fn_goldsourceconfig
- elif [ "${gamename}" == "Day of Defeat: Source" ]; then
- echo -e "downloading lgsm-default.cfg...\c"
- wget -N --no-check-certificate /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/DayOfDefeatSource/cfg/lgsm-default.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq
- sleep 1
- fn_sourceconfig
- elif [ "${gamename}" == "Fistful of Frags" ]; then
- echo -e "downloading lgsm-default.cfg...\c"
- wget -N --no-check-certificate /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/FistfulOfFrags/cfg/lgsm-default.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq
- sleep 1
- fn_sourceconfig
- elif [ "${gamename}" == "Garry's Mod" ]; then
- echo -e "downloading lgsm-default.cfg...\c"
- wget -N --no-check-certificate /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/GarrysMod/cfg/lgsm-default.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq
- sleep 1
- fn_sourceconfig
- elif [ "${gamename}" == "Half Life 2: Deathmatch" ]; then
- echo -e "downloading lgsm-default.cfg...\c"
- wget -N --no-check-certificate /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/HalfLife2Deathmatch/cfg/lgsm-default.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq
- sleep 1
- fn_sourceconfig
- elif [ "${gamename}" == "Half Life: Deathmatch Classic" ]; then
- echo -e "downloading lgsm-default.cfg...\c"
- wget -N --no-check-certificate /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/HalfLifeDeathmatchClassic/cfg/lgsm-default.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq
- sleep 1
- fn_goldsourceconfig
- elif [ "${gamename}" == "Insurgency" ]; then
- echo -e "downloading lgsm-default.cfg...\c"
- wget -N --no-check-certificate /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/Insurgency/cfg/lgsm-default.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq
- sleep 1
- fn_sourceconfig
- elif [ "${gamename}" == "Just Cause 2" ]; then
- fn_jc2config
- elif [ "${gamename}" == "Killing Floor" ]; then
- fn_unreal2config
- elif [ "${gamename}" == "Left 4 Dead" ]; then
- echo -e "downloading lgsm-default.cfg...\c"
- wget -N --no-check-certificate /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/Left4Dead/cfg/lgsm-default.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq
- sleep 1
- fn_sourceconfig
- elif [ "${gamename}" == "Left 4 Dead 2" ]; then
- echo -e "downloading lgsm-default.cfg...\c"
- wget -N --no-check-certificate /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/Left4Dead2/cfg/lgsm-default.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq
- sleep 1
- fn_sourceconfig
- elif [ "${gamename}" == "No More Room in Hell" ]; then
- echo -e "downloading lgsm-default.cfg...\c"
- wget -N --no-check-certificate /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/NoMoreRoomInHell/cfg/lgsm-default.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq
- sleep 1
- fn_sourceconfig
- elif [ "${gamename}" == "Natural Selection 2" ]; then
- echo -e "no configs required."
- sleep 1
- echo ""
- elif [ "${gamename}" == "Red Orchestra: Ostfront 41-45" ]; then
- fn_unreal2config
- elif [ "${gamename}" == "Serious Sam 3: BFE" ]; then
- echo -e "downloading lgsm-default.ini...\c"
- wget -N --no-check-certificate /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/SeriousSam3BFE/cfg/lgsm-default.ini 2>&1 | grep -F HTTP | cut -c45- | uniq
- sleep 1
- fn_serious3config
- elif [ "${gamename}" == "Team Fortress 2" ]; then
- echo -e "downloading lgsm-default.cfg...\c"
- wget -N --no-check-certificate /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/TeamFortress2/cfg/lgsm-default.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq
- sleep 1
- fn_sourceconfig
- elif [ "${gamename}" == "Team Fortress Classic" ]; then
- echo -e "downloading lgsm-default.cfg...\c"
- wget -N --no-check-certificate /dev/null https://raw.githubusercontent.com/dgibbs64/linuxgameservers/master/TeamFortressClassic/cfg/lgsm-default.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq
- sleep 1
- fn_goldsourceconfig
- elif [ "${gamename}" == "Unreal Tournament 2004" ]; then
- fn_unreal2config
- elif [ "${gamename}" == "Unreal Tournament 99" ]; then
- fn_ut99config
- fi
|