Browse Source

Revert "added missing space"

This reverts commit e271b7f40d.
pull/457/head
Daniel Gibbs 10 years ago
parent
commit
b2cfe2905f
  1. 2
      DontStarveTogether/lgsm-default.ini
  2. 10
      functions/fn_details
  3. 66
      functions/fn_details_config
  4. 19
      functions/fn_install_config
  5. 18
      functions/fn_update_functions

2
DontStarveTogether/lgsm-default.ini

@ -7,7 +7,7 @@ server_password = password
# max_players = 1 .. 64
max_players = 16
# pvp = true | false
#pvp = true | false
pvp = false
# game_mode = endless | survival | wilderness

10
functions/fn_details

@ -88,16 +88,6 @@ if [ -n "${slots}" ]; then
echo -e "\e[34mSlots:\t\e[0m${slots}" >> .fn_details_gameserver
fi
# game mode
if [ -n "${gamemode}" ]; then
echo -e "\e[34mGame Mode:\t\e[0m${gamemode}" >> .fn_details_gameserver
fi
# tick rate
if [ -n "${tickrate}" ]; then
echo -e "\e[34mTick rate:\t\e[0m${tickrate}" >> .fn_details_gameserver
fi
# online status
if [ "${gamename}" == "Teamspeak 3" ]; then
fn_check_ts3status

66
functions/fn_details_config

@ -8,54 +8,50 @@
if [ -e "${servercfgfullpath}" ]||[ "${engine}" == "spark" ]||[ "${gamename}" == "Teamspeak 3" ]; then
if [ "${engine}" == "avalanche" ]; then
servername=$(grep -s "Name" "${servercfgfullpath}"|sed 's/Name//g'|tr -d '=\"; '|sed 's/,//g')
servername=$(grep -s Name "${servercfgfullpath}"|sed 's/Name//g'|tr -d '=\"; '|sed 's/,//g')
# check if the ip exists in the config file. Failing this will fall back to the default.
configipcheck=$(grep "BindIP" "${servercfgfullpath}"|sed 's/BindIP//g'|tr -d '=\"; '|sed 's/,//g')
configipcheck=$(grep BindIP "${servercfgfullpath}"|sed 's/BindIP//g'|tr -d '=\"; '|sed 's/,//g')
if [ -n "${configipcheck}" ]; then
ip=$(grep "BindIP" "${servercfgfullpath}"|sed 's/BindIP//g'|tr -d '=\"; '|sed 's/,//g')
ip=$(grep BindIP "${servercfgfullpath}"|sed 's/BindIP//g'|tr -d '=\"; '|sed 's/,//g')
fi
port=$(grep "BindPort" "${servercfgfullpath}"|tr -cd [:digit:])
serverpassword=$(grep -s "Password" "${servercfgfullpath}"|sed 's/Password//g'|tr -d '=\"; '|sed 's/,//g')
slots=$(grep -s "MaxPlayers" "${servercfgfullpath}"|tr -cd [:digit:])
port=$(grep BindPort "${servercfgfullpath}"|sed 's/BindPort//g'|tr -d '=\"; '|sed 's/,//g')
serverpassword=$(grep -s Password "${servercfgfullpath}"|sed 's/Password//g'|tr -d '=\"; '|sed 's/,//g')
slots=$(grep -s MaxPlayers "${servercfgfullpath}"|sed 's/MaxPlayers//g'|tr -d '=\"; '|sed 's/,//g')
elif [ "${engine}" == "dontstarve" ]; then
servername=$(grep -s "default_server_name = " "${servercfgfullpath}"|sed 's/default_server_name = //g'|tr -d '=\";'|sed 's/,//g')
port=$(grep -s "server_port" "${servercfgfullpath}"|grep -v "#"|tr -cd "[:digit:]")
serverpassword=$(grep -s "server_password = " "${servercfgfullpath}"|grep -v "#"|sed 's/server_password = //g'|tr -d '=\"; '|sed 's/,//g')
slots=$(grep -s "max_players" "${servercfgfullpath}"|grep -v "#"|tr -cd [:digit:])
gamemode=$(grep -s "game_mode = " "${servercfgfullpath}"|grep -v "#"|sed 's/game_mode = //g'|tr -d '=\"; '|sed 's/,//g')
tickrate=$(grep -s "tick_rate" "${servercfgfullpath}"|grep -v "#"|tr -cd [:digit:])
port=$(grep -s "server_port = " "${servercfgfullpath}"|sed 's/server_port = //g'|tr -cd [:digit:])
elif [ "${engine}" == "projectzomboid" ]; then
servername=$(grep -s "PublicName=" "${servercfgfullpath}"|sed 's/PublicName=//g'|tr -d '=\";'|sed 's/,//g')
port=$(grep -s "DefaultPort=" "${servercfgfullpath}"|sed 's/DefaultPort=//g'|tr -cd [:digit:])
servername=$(grep -s PublicName= "${servercfgfullpath}"|sed 's/PublicName=//g'|tr -d '=\";'|sed 's/,//g')
port=$(grep -s DefaultPort= "${servercfgfullpath}"|sed 's/DefaultPort=//g'|tr -cd [:digit:])
elif [ "${engine}" == "realvirtuality" ]; then
servername=$(grep -s "hostname" "${servercfgfullpath}"| grep -v //|sed -e 's/\<hostname\>//g'| tr -d '=\"; ')
port=$(grep -s "serverport=" "${servercfgfullpath}"|grep -v //|tr -d '\r'|tr -cd [:digit:])
queryport=$(grep -s "steamqueryport=" "${servercfgfullpath}"|grep -v //|tr -d '\r'|tr -cd [:digit:])
masterport=$(grep -s "steamport=" "${servercfgfullpath}"|grep -v //|tr -d '\r'|tr -cd [:digit:])
servername=$(grep -s hostname "${servercfgfullpath}"| grep -v //|sed -e 's/\<hostname\>//g'| tr -d '=\"; ')
port=$(grep -s serverport= "${servercfgfullpath}"|grep -v //|tr -d '\r'|tr -cd [:digit:])
queryport=$(grep -s steamqueryport= "${servercfgfullpath}"|grep -v //|tr -d '\r'|tr -cd [:digit:])
masterport=$(grep -s steamport= "${servercfgfullpath}"|grep -v //|tr -d '\r'|tr -cd [:digit:])
elif [ "${engine}" == "seriousengine35" ]; then
servername=$(grep -s "prj_strMultiplayerSessionName" "${servercfgfullpath}"|sed 's/prj_strMultiplayerSessionName = //g'|sed 's/"//g'|sed 's/;//g')
rcon=$(grep -s "rcts_strAdminPassword" "${servercfgfullpath}"|sed 's/rcts_strAdminPassword = //g'|sed 's/"//g'|sed 's/;//g')
port=$(grep -s "prj_uwPort" "${servercfgfullpath}"|tr -d '\r'|tr -cd [:digit:])
servername=$(grep -s prj_strMultiplayerSessionName "${servercfgfullpath}"|sed 's/prj_strMultiplayerSessionName = //g'|sed 's/"//g'|sed 's/;//g')
rcon=$(grep -s rcts_strAdminPassword "${servercfgfullpath}"|sed 's/rcts_strAdminPassword = //g'|sed 's/"//g'|sed 's/;//g')
port=$(grep -s prj_uwPort "${servercfgfullpath}"|tr -d '\r'|tr -cd [:digit:])
queryport=$((${port} + 1))
elif [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]; then
servername=$(grep -s "hostname" "${servercfgfullpath}"|sed 's/hostname //g'|sed 's/"//g')
rcon=$(grep -s "rcon_password" "${servercfgfullpath}"|sed 's/rcon_password //g'|sed 's/"//g')
servername=$(grep -s hostname "${servercfgfullpath}"|sed 's/hostname //g'|sed 's/"//g')
rcon=$(grep -s rcon_password "${servercfgfullpath}"|sed 's/rcon_password //g'|sed 's/"//g')
elif [ "${engine}" == "spark" ]; then
queryport=$((${port} + 1))
elif [ "${gamename}" == "Teamspeak 3" ]; then
if [ -s "${servercfgfullpath}" ]; then
port=$(grep "default_voice_port=" "${servercfgfullpath}"|tr -cd [:digit:])
queryport=$(grep "query_port=" "${servercfgfullpath}"|tr -cd [:digit:])
fileport=$(grep "filetransfer_port=" "${servercfgfullpath}"|tr -cd [:digit:])
ip=$(grep "voice_ip=" "${servercfgfullpath}"|sed 's/\voice_ip=//g')
dbplugin=$(grep "dbplugin=" "${servercfgfullpath}"|sed 's/\dbplugin=//g')
port=$(grep default_voice_port= "${servercfgfullpath}"|tr -cd [:digit:])
queryport=$(grep query_port= "${servercfgfullpath}"|tr -cd [:digit:])
fileport=$(grep filetransfer_port= "${servercfgfullpath}"|tr -cd [:digit:])
ip=$(grep voice_ip= "${servercfgfullpath}"|sed 's/\voice_ip=//g')
dbplugin=$(grep dbplugin= "${servercfgfullpath}"|sed 's/\dbplugin=//g')
else
port="9987"
queryport="10011"
@ -63,15 +59,15 @@ if [ -e "${servercfgfullpath}" ]||[ "${engine}" == "spark" ]||[ "${gamename}" ==
fi
elif [ "${engine}" == "unity3d" ]; then
servername=$(grep "ServerName" "${servercfgfullpath}"|sed 's/^.*value="//'|cut -f1 -d"\"")
port=$(grep "ServerPort" "${servercfgfullpath}"|tr -cd [:digit:])
servername=$(grep ServerName "${servercfgfullpath}"|sed 's/^.*value="//'|cut -f1 -d"\"")
port=$(grep ServerPort "${servercfgfullpath}"|tr -cd [:digit:])
queryport=$((${port} + 1))
webadminenabled=$(grep "ControlPanelEnabled" "${servercfgfullpath}"|sed 's/^.*value="//'|cut -f1 -d"\"")
webadminport=$(grep "ControlPanelPort" "${servercfgfullpath}"|tr -cd [:digit:])
webadminpass=$(grep "ControlPanelPassword" "${servercfgfullpath}"|sed 's/^.*value="//'|cut -f1 -d"\"")
telnetenabled=$(grep "TelnetEnabled" "${servercfgfullpath}"|sed 's/^.*value="//'|cut -f1 -d"\"")
telnetport=$(grep "TelnetPort" "${servercfgfullpath}"|tr -cd [:digit:])
telnetpass=$(grep "TelnetPassword" "${servercfgfullpath}"|sed 's/^.*value="//'|cut -f1 -d"\"")
webadminenabled=$(grep ControlPanelEnabled "${servercfgfullpath}"|sed 's/^.*value="//'|cut -f1 -d"\"")
webadminport=$(grep ControlPanelPort "${servercfgfullpath}"|tr -cd [:digit:])
webadminpass=$(grep ControlPanelPassword "${servercfgfullpath}"|sed 's/^.*value="//'|cut -f1 -d"\"")
telnetenabled=$(grep TelnetEnabled "${servercfgfullpath}"|sed 's/^.*value="//'|cut -f1 -d"\"")
telnetport=$(grep TelnetPort "${servercfgfullpath}"|tr -cd [:digit:])
telnetpass=$(grep TelnetPassword "${servercfgfullpath}"|sed 's/^.*value="//'|cut -f1 -d"\"")
if [ -z "${telnetpass}" ]; then
telnetpass="\e[0;31mno password set\e[0m"
fi

19
functions/fn_install_config

@ -174,23 +174,22 @@ echo ""
echo "Creating Configs"
echo "================================="
sleep 1
if [ -z ${servercfgdir+x} ];
if [ ! -d "${servercfgdir}" ]; then
echo -e "creating ${servercfgdir} dir...\c"
mkdir -pv "${servercfgdir}"
if [[ $? == 0 ]]; then
echo -e "OK"
else
echo -e "FAIL"
fi
if [ ! -d "${servercfgdir}" ]; then
echo -e "creating ${servercfgdir} dir...\c"
mkdir -pv "${servercfgdir}"
if [[ $? == 0 ]]; then
echo -e "OK"
else
echo -e "FAIL"
fi
fi
if [ "${gamename}" == "ARMA 3" ]; then
cd "${systemdir}"
else
cd "${servercfgdir}"
fi
#statements
if [ "${gamename}" == "7 Days To Die" ]; then
fn_unity3dconfig
elif [ "${gamename}" == "ARK: Survivial Evolved" ]; then

18
functions/fn_update_functions

@ -19,20 +19,4 @@ else
fn_printokfail "Updating functions"
fn_scriptlog "Failure! Updating functions"
fi
sleep 1
fn_printdots "Checking for ${selfname} script update"
fn_scriptlog "Checking for ${selfname} script update"
currentversion=$(wget -O- -q https://gameservermanagers.com/dl/${selfname}|grep version=)
currentversion
if [ "${version}" == "${currentversion}" ]; then
fn_printok "New version of ${selfname} available"
fn_scriptlog "New version of ${selfname} available"
else
fn_printok "${selfname} is up to date"
fn_printok "${selfname} is up to date"
fi
echo -ne "\n"
echo -ne "\n"
Loading…
Cancel
Save