Browse Source

Merge pull request #276 from Poil/master

Fix : binary operator expected and don't use a not not operator
pull/292/head
Daniel Gibbs 10 years ago
parent
commit
74e89b2cef
  1. 6
      7DaysToDie/sdtdserver
  2. 6
      Arma3/arma3server
  3. 6
      BladeSymphony/bsserver
  4. 6
      CounterStrike/csserver
  5. 6
      CounterStrikeGlobalOffensive/csgoserver
  6. 6
      CounterStrikeSource/cssserver
  7. 6
      DayOfDefeat/dodserver
  8. 6
      DayOfDefeatSource/dodsserver
  9. 6
      FistfulOfFrags/fofserver
  10. 6
      GarrysMod/gmodserver
  11. 6
      HalfLife2Deathmatch/hl2dmserver
  12. 6
      HalfLifeDeathmatchClassic/hldmcserver
  13. 6
      Insurgency/insserver
  14. 6
      JustCause2/jc2server
  15. 6
      KillingFloor/kfserver
  16. 6
      Left4Dead/l4dserver
  17. 6
      Left4Dead2/l4d2server
  18. 6
      Mumble/mumbleserver
  19. 6
      NaturalSelection2/ns2server
  20. 6
      NoMoreRoomInHell/nmrihserver
  21. 6
      RedOrchestra/roserver
  22. 6
      SeriousSam3BFE/ss3sserver
  23. 6
      TeamFortress2/tf2server
  24. 6
      TeamFortressClassic/tfcserver
  25. 4
      TheHiddenSource/thsserver
  26. 6
      UnrealTournament2004/ut2k4server
  27. 6
      UnrealTournament99/ut99server
  28. 15
      functions/fn_autoip
  29. 21
      functions/fn_check_ip
  30. 8
      functions/fn_check_logs
  31. 4
      functions/fn_compress_unreal2maps
  32. 4
      functions/fn_compress_ut99maps
  33. 14
      functions/fn_details_distro
  34. 14
      functions/fn_distrodetails
  35. 8
      functions/fn_install_logs
  36. 8
      functions/fn_loginstall
  37. 22
      functions/fn_messages
  38. 4
      functions/fn_unreal2compressmaps
  39. 4
      functions/fn_ut99compressmaps

6
7DaysToDie/sdtdserver

@ -40,8 +40,8 @@ engine="unity3d"
# Directories
rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
selfname="$0"
lockselfname=$(echo ".${servicename}.lock")
selfname="$(basename $0)"
lockselfname=".${servicename}.lock"
filesdir="${rootdir}/serverfiles"
systemdir="${filesdir}"
executabledir="${filesdir}"
@ -94,4 +94,4 @@ fn_runfunction
fn_functions
getopt=$1
fn_getopt
fn_getopt

6
Arma3/arma3server

@ -36,8 +36,8 @@ engine="realvirtuality"
# Directories
rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )"
selfname="$0"
lockselfname=$(echo ".${servicename}.lock")
selfname="$(basename $0)"
lockselfname=".${servicename}.lock"
filesdir="${rootdir}/serverfiles"
systemdir="${filesdir}"
executabledir="${filesdir}"
@ -89,4 +89,4 @@ fn_runfunction
fn_functions
getopt=$1
fn_getopt
fn_getopt

6
BladeSymphony/bsserver

@ -41,8 +41,8 @@ engine="source"
# Directories
rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )"
selfname="$0"
lockselfname=$(echo ".${servicename}.lock")
selfname="$(basename $0)"
lockselfname=".${servicename}.lock"
filesdir="${rootdir}/serverfiles"
systemdir="${filesdir}/berimbau"
executabledir="${filesdir}"
@ -95,4 +95,4 @@ fn_runfunction
fn_functions
getopt=$1
fn_getopt
fn_getopt

6
CounterStrike/csserver

@ -40,8 +40,8 @@ engine="goldsource"
# Directories
rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )"
selfname="$0"
lockselfname=$(echo ".${servicename}.lock")
selfname="$(basename $0)"
lockselfname=".${servicename}.lock"
filesdir="${rootdir}/serverfiles"
systemdir="${filesdir}/cstrike"
executabledir="${filesdir}"
@ -94,4 +94,4 @@ fn_runfunction
fn_functions
getopt=$1
fn_getopt
fn_getopt

6
CounterStrikeGlobalOffensive/csgoserver

@ -58,8 +58,8 @@ engine="source"
# Directories
rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )"
selfname="$0"
lockselfname=$(echo ".${servicename}.lock")
selfname="$(basename $0)"
lockselfname=".${servicename}.lock"
filesdir="${rootdir}/serverfiles"
systemdir="${filesdir}/csgo"
executabledir="${filesdir}"
@ -112,4 +112,4 @@ fn_runfunction
fn_functions
getopt=$1
fn_getopt
fn_getopt

6
CounterStrikeSource/cssserver

@ -41,8 +41,8 @@ engine="source"
# Directories
rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
selfname="$0"
lockselfname=$(echo ".${servicename}.lock")
selfname="$(basename $0)"
lockselfname=".${servicename}.lock"
filesdir="${rootdir}/serverfiles"
systemdir="${filesdir}/cstrike"
executabledir="${filesdir}"
@ -95,4 +95,4 @@ fn_runfunction
fn_functions
getopt=$1
fn_getopt
fn_getopt

6
DayOfDefeat/dodserver

@ -40,8 +40,8 @@ engine="goldsource"
# Directories
rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
selfname="$0"
lockselfname=$(echo ".${servicename}.lock")
selfname="$(basename $0)"
lockselfname=".${servicename}.lock"
filesdir="${rootdir}/serverfiles"
systemdir="${filesdir}/dod"
executabledir="${filesdir}"
@ -94,4 +94,4 @@ fn_runfunction
fn_functions
getopt=$1
fn_getopt
fn_getopt

6
DayOfDefeatSource/dodsserver

@ -41,8 +41,8 @@ engine="source"
# Directories
rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
selfname="$0"
lockselfname=$(echo ".${servicename}.lock")
selfname="$(basename $0)"
lockselfname=".${servicename}.lock"
filesdir="${rootdir}/serverfiles"
systemdir="${filesdir}/dod"
executabledir="${filesdir}"
@ -95,4 +95,4 @@ fn_runfunction
fn_functions
getopt=$1
fn_getopt
fn_getopt

6
FistfulOfFrags/fofserver

@ -41,8 +41,8 @@ engine="source"
# Directories
rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
selfname="$0"
lockselfname=$(echo ".${servicename}.lock")
selfname="$(basename $0)"
lockselfname=".${servicename}.lock"
filesdir="${rootdir}/serverfiles"
systemdir="${filesdir}/fof"
executabledir="${filesdir}"
@ -95,4 +95,4 @@ fn_runfunction
fn_functions
getopt=$1
fn_getopt
fn_getopt

6
GarrysMod/gmodserver

@ -46,8 +46,8 @@ engine="source"
# Directories
rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
selfname="$0"
lockselfname=$(echo ".${servicename}.lock")
selfname="$(basename $0)"
lockselfname=".${servicename}.lock"
filesdir="${rootdir}/serverfiles"
systemdir="${filesdir}/garrysmod"
executabledir="${filesdir}"
@ -100,4 +100,4 @@ fn_runfunction
fn_functions
getopt=$1
fn_getopt
fn_getopt

6
HalfLife2Deathmatch/hl2dmserver

@ -41,8 +41,8 @@ engine="source"
# Directories
rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
selfname="$0"
lockselfname=$(echo ".${servicename}.lock")
selfname="$(basename $0)"
lockselfname=".${servicename}.lock"
filesdir="${rootdir}/serverfiles"
systemdir="${filesdir}/hl2mp"
executabledir="${filesdir}"
@ -95,4 +95,4 @@ fn_runfunction
fn_functions
getopt=$1
fn_getopt
fn_getopt

6
HalfLifeDeathmatchClassic/hldmcserver

@ -40,8 +40,8 @@ engine="goldsource"
# Directories
rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
selfname="$0"
lockselfname=$(echo ".${servicename}.lock")
selfname="$(basename $0)"
lockselfname=".${servicename}.lock"
filesdir="${rootdir}/serverfiles"
systemdir="${filesdir}/valve"
executabledir="${filesdir}"
@ -94,4 +94,4 @@ fn_runfunction
fn_functions
getopt=$1
fn_getopt
fn_getopt

6
Insurgency/insserver

@ -41,8 +41,8 @@ engine="source"
# Directories
rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
selfname="$0"
lockselfname=$(echo ".${servicename}.lock")
selfname="$(basename $0)"
lockselfname=".${servicename}.lock"
filesdir="${rootdir}/serverfiles"
systemdir="${filesdir}/insurgency"
executabledir="${filesdir}"
@ -95,4 +95,4 @@ fn_runfunction
fn_functions
getopt=$1
fn_getopt
fn_getopt

6
JustCause2/jc2server

@ -37,8 +37,8 @@ engine="avalanche"
# Directories
rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
selfname="$0"
lockselfname=$(echo ".${servicename}.lock")
selfname="$(basename $0)"
lockselfname=".${servicename}.lock"
filesdir="${rootdir}/serverfiles"
systemdir="${filesdir}"
executabledir="${filesdir}"
@ -90,4 +90,4 @@ fn_runfunction
fn_functions
getopt=$1
fn_getopt
fn_getopt

6
KillingFloor/kfserver

@ -40,8 +40,8 @@ appid="215360"
# Directories
rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
selfname="$0"
lockselfname=$(echo ".${servicename}.lock")
selfname="$(basename $0)"
lockselfname=".${servicename}.lock"
filesdir="${rootdir}/serverfiles"
systemdir="${filesdir}/System"
executabledir="${systemdir}"
@ -97,4 +97,4 @@ fn_runfunction
fn_functions
getopt=$1
fn_getopt
fn_getopt

6
Left4Dead/l4dserver

@ -41,8 +41,8 @@ engine="source"
# Directories
rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
selfname="$0"
lockselfname=$(echo ".${servicename}.lock")
selfname="$(basename $0)"
lockselfname=".${servicename}.lock"
filesdir="${rootdir}/serverfiles"
systemdir="${filesdir}/left4dead"
executabledir="${filesdir}"
@ -95,4 +95,4 @@ fn_runfunction
fn_functions
getopt=$1
fn_getopt
fn_getopt

6
Left4Dead2/l4d2server

@ -40,8 +40,8 @@ engine="source"
# Directories
rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
selfname="$0"
lockselfname=$(echo ".${servicename}.lock")
selfname="$(basename $0)"
lockselfname=".${servicename}.lock"
filesdir="${rootdir}/serverfiles"
systemdir="${filesdir}/left4dead2"
executabledir="${filesdir}"
@ -94,4 +94,4 @@ fn_runfunction
fn_functions
getopt=$1
fn_getopt
fn_getopt

6
Mumble/mumbleserver

@ -18,8 +18,8 @@ servicename="mumble-server"
# Directorys
rootdir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
selfname="$0"
lockselfname=$(echo ".${servicename}.lock")
selfname="$(basename $0)"
lockselfname=".${servicename}.lock"
filesdir="${rootdir}/serverfiles"
ini="murmur.ini"
executable="./murmur.x86 -fg -ini ${ini}"
@ -480,4 +480,4 @@ case "$1" in
echo "Usage: $0 {start|stop|restart|monitor|debug|backup|email-test}"
exit 1;;
esac
exit
exit

6
NaturalSelection2/ns2server

@ -50,8 +50,8 @@ engine="spark"
# Directories
rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
selfname="$0"
lockselfname=$(echo ".${servicename}.lock")
selfname="$(basename $0)"
lockselfname=".${servicename}.lock"
filesdir="${rootdir}/serverfiles"
systemdir="${filesdir}"
executabledir="${filesdir}"
@ -100,4 +100,4 @@ fn_runfunction
fn_functions
getopt=$1
fn_getopt
fn_getopt

6
NoMoreRoomInHell/nmrihserver

@ -41,8 +41,8 @@ engine="source"
# Directories
rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
selfname="$0"
lockselfname=$(echo ".${servicename}.lock")
selfname="$(basename $0)"
lockselfname=".${servicename}.lock"
filesdir="${rootdir}/serverfiles"
systemdir="${filesdir}/nmrih"
executabledir="${filesdir}"
@ -95,4 +95,4 @@ fn_runfunction
fn_functions
getopt=$1
fn_getopt
fn_getopt

6
RedOrchestra/roserver

@ -36,8 +36,8 @@ appid="223250"
# Directories
rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
selfname="$0"
lockselfname=$(echo ".${servicename}.lock")
selfname="$(basename $0)"
lockselfname=".${servicename}.lock"
filesdir="${rootdir}/serverfiles"
systemdir="${filesdir}/system"
executabledir="${systemdir}"
@ -93,4 +93,4 @@ fn_runfunction
fn_functions
getopt=$1
fn_getopt
fn_getopt

6
SeriousSam3BFE/ss3sserver

@ -36,8 +36,8 @@ engine="seriousengine35"
# Directories
rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
selfname="$0"
lockselfname=$(echo ".${servicename}.lock")
selfname="$(basename $0)"
lockselfname=".${servicename}.lock"
filesdir="${rootdir}/serverfiles"
systemdir="${filesdir}/Bin"
executabledir="${systemdir}"
@ -91,4 +91,4 @@ fn_runfunction
fn_functions
getopt=$1
fn_getopt
fn_getopt

6
TeamFortress2/tf2server

@ -41,8 +41,8 @@ engine="source"
# Directories
rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
selfname="$0"
lockselfname=$(echo ".${servicename}.lock")
selfname="$(basename $0)"
lockselfname=".${servicename}.lock"
filesdir="${rootdir}/serverfiles"
systemdir="${filesdir}/tf"
executabledir="${filesdir}"
@ -95,4 +95,4 @@ fn_runfunction
fn_functions
getopt=$1
fn_getopt
fn_getopt

6
TeamFortressClassic/tfcserver

@ -40,8 +40,8 @@ engine="goldsource"
# Directories
rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
selfname="$0"
lockselfname=$(echo ".${servicename}.lock")
selfname="$(basename $0)"
lockselfname=".${servicename}.lock"
filesdir="${rootdir}/serverfiles"
systemdir="${filesdir}/tfc"
executabledir="${filesdir}"
@ -94,4 +94,4 @@ fn_runfunction
fn_functions
getopt=$1
fn_getopt
fn_getopt

4
TheHiddenSource/thsserver

@ -30,7 +30,7 @@ engine="source"
# Directorys
rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )"
selfname="$0"
selfname="$(basename $0)"
filesdir="${rootdir}/serverfiles"
servercfg="${filesdir}/hidden/cfg/${servicename}.cfg"
backupdir="backups"
@ -718,4 +718,4 @@ case "$1" in
echo "Usage: $0 {start|stop|restart|update|monitor|install|debug|email-test|details}"
exit 1;;
esac
exit
exit

6
UnrealTournament2004/ut2k4server

@ -27,8 +27,8 @@ engine="unreal2"
# Directories
rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
selfname="$0"
lockselfname=$(echo ".${servicename}.lock")
selfname="$(basename 0)"
lockselfname=".${servicename}.lock"
filesdir="${rootdir}/serverfiles"
systemdir="${filesdir}/System"
executabledir="${systemdir}"
@ -84,4 +84,4 @@ fn_runfunction
fn_functions
getopt=$1
fn_getopt
fn_getopt

6
UnrealTournament99/ut99server

@ -29,8 +29,8 @@ engine="unreal"
# Directories
rootdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
selfname="$0"
lockselfname=$(echo ".${servicename}.lock")
selfname="$(basename 0)"
lockselfname=".${servicename}.lock"
filesdir="${rootdir}/serverfiles"
systemdir="${filesdir}/System"
executabledir="${systemdir}"
@ -83,4 +83,4 @@ fn_runfunction
fn_functions
getopt=$1
fn_getopt
fn_getopt

15
functions/fn_autoip

@ -12,17 +12,8 @@ if [ ! -f /bin/ip ]; then
else
ipcommand="ip"
fi
getip=$(${ipcommand} -o -4 addr|awk '{print $4 }'|grep -oe '\([0-9]\{1,3\}\.\?\)\{4\}'|grep -v 127.0.0)
getipwc=$(${ipcommand} -o -4 addr|awk '{print $4 }'|grep -oe '\([0-9]\{1,3\}\.\?\)\{4\}'|grep -vc 127.0.0)
getip=$(hostname -I)
if [ "${ip}" == "0.0.0.0" ]||[ "${ip}" == "" ]; then
if [ "${getipwc}" -ge "2" ]; then
fn_printwarn "Multiple active network interfaces found.\n\n"
echo -en "Manually specify the IP you want to use within the ${selfname} script.\n"
echo -en "Set ip=\"0.0.0.0\" to one of the following:\n"
echo -en "${getip}\n"
exit
else
ip=${getip}
fi
fi
ip=${getip}
fi

21
functions/fn_check_ip

@ -7,22 +7,9 @@
# Description: Automatically identifies the server interface IP.
# If multiple interfaces are detected the user will need to manualy set using ip="0.0.0.0".
if [ ! -f /bin/ip ]; then
ipcommand="/sbin/ip"
else
ipcommand="ip"
fi
getip=$(${ipcommand} -o -4 addr|awk '{print $4 }'|grep -oe '\([0-9]\{1,3\}\.\?\)\{4\}'|grep -v 127.0.0)
getipwc=$(${ipcommand} -o -4 addr|awk '{print $4 }'|grep -oe '\([0-9]\{1,3\}\.\?\)\{4\}'|grep -vc 127.0.0)
getip=$(hostname -I)
if [ "${ip}" == "0.0.0.0" ]||[ "${ip}" == "" ]; then
if [ "${getipwc}" -ge "2" ]; then
fn_printwarn "Multiple active network interfaces found.\n\n"
echo -en "Manually specify the IP you want to use within the ${selfname} script.\n"
echo -en "Set ip=\"0.0.0.0\" to one of the following:\n"
echo -en "${getip}\n"
exit
else
ip=${getip}
fi
fi
ip=${getip}
fi

8
functions/fn_check_logs

@ -17,7 +17,7 @@ touch "${consolelog}"
# If a server is source or goldsource create a symbolic link to the game server logs
if [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]; then
if [ ! -h "${rootdir}/log/server" ]; then
ln -sv "${gamelogdir}" "${rootdir}/log/server"
ln -nfsv "${gamelogdir}" "${rootdir}/log/server"
else
echo "Symbolic link ${gamelogdir} => ${rootdir}/log/server already exists!"
fi
@ -28,15 +28,15 @@ if [ "${engine}" == "unreal2" ]||[ "${engine}" == "unity3d" ]; then
fi
if [ "${gamename}" == "7 Days To Die" ]; then
if [ ! -h "${gamelogdir}/output_log.txt" ]; then
ln -sv "${filesdir}/7DaysToDie_Data/output_log.txt" "${gamelogdir}/output_log.txt"
ln -nfsv "${filesdir}/7DaysToDie_Data/output_log.txt" "${gamelogdir}/output_log.txt"
fi
fi
# If server uses SteamCMD create a symbolic link to the Steam logs
if [ -d "${rootdir}/Steam/logs" ]; then
if [ ! -h "${rootdir}/log/steamcmd" ]; then
ln -sv "${rootdir}/Steam/logs" "${rootdir}/log/steamcmd"
ln -nfsv "${rootdir}/Steam/logs" "${rootdir}/log/steamcmd"
else
echo "Symbolic link ${rootdir}/Steam/logs => ${rootdir}/log/steamcmd already exists!"
fi
fi
sleep 1
sleep 1

4
functions/fn_compress_unreal2maps

@ -27,7 +27,7 @@ done
mkdir -pv "${compressedmapsdir}" > /dev/null 2>&1
rm -rfv "${filesdir}/Maps/*.uz2"
cd "${systemdir}"
for map in `ls "${filesdir}/Maps"`; do
for map in "${filesdir}/Maps/*"; do
./ucc-bin compress "../Maps/${map}" --nohomedir
done
mv -fv "${filesdir}/Maps/*.uz2" "${compressedmapsdir}"
mv -fv "${filesdir}/Maps/*.uz2" "${compressedmapsdir}"

4
functions/fn_compress_ut99maps

@ -27,7 +27,7 @@ done
mkdir -pv "${compressedmapsdir}" > /dev/null 2>&1
rm -rfv "${filesdir}/Maps/*.unr.uz"
cd "${systemdir}"
for map in `ls "${filesdir}/Maps"`; do
for map in "${filesdir}/Maps/*"; do
./ucc-bin compress ../Maps/${map} --nohomedir
done
mv -fv "${filesdir}/Maps/*.unr.uz" "${compressedmapsdir}"
mv -fv "${filesdir}/Maps/*.unr.uz" "${compressedmapsdir}"

14
functions/fn_details_distro

@ -48,12 +48,12 @@ if [ "$(free -h > /dev/null 2>&1; echo $?)" -ne "0" ]; then
else
option="-h"
fi
physmemtotal=$(free ${option} | grep "Mem:" | awk '{print $2}')
physmemused=$(free ${option} | grep "Mem:" | awk '{print $3}')
physmemfree=$(free ${option} | grep "Mem:" | awk '{print $4}')
swaptotal=$(free ${option} | grep "Swap:" | awk '{print $2}')
swapused=$(free ${option} | grep "Swap:" | awk '{print $3}')
swapfree=$(free ${option} | grep "Swap:" | awk '{print $4}')
physmemtotal=$(free ${option} | awk '/Mem:/ {print $2}')
physmemused=$(free ${option} | awk '/Mem:/ {print $3}')
physmemfree=$(free ${option} | awk '/Mem:/ {print $4}')
swaptotal=$(free ${option} | | awk '/Swap:/ {print $2}')
swapused=$(free ${option} | awk '/Swap:/ {print $3}')
swapfree=$(free ${option} | awk '/Swap:/ {print $4}')
# Uptime
uptime=$(</proc/uptime)
@ -87,4 +87,4 @@ if [ -d "${backupdir}" ]; then
# size of most recent backup.
lastbackupsize=$(du -h "${lastbackup}" | awk '{print $1}')
fi
fi

14
functions/fn_distrodetails

@ -48,12 +48,12 @@ if [ "$(free -h > /dev/null 2>&1; echo $?)" -ne "0" ]; then
else
option="-h"
fi
physmemtotal=$(free ${option} | grep "Mem:" | awk '{print $2}')
physmemused=$(free ${option} | grep "Mem:" | awk '{print $3}')
physmemfree=$(free ${option} | grep "Mem:" | awk '{print $4}')
swaptotal=$(free ${option} | grep "Swap:" | awk '{print $2}')
swapused=$(free ${option} | grep "Swap:" | awk '{print $3}')
swapfree=$(free ${option} | grep "Swap:" | awk '{print $4}')
physmemtotal=$(free ${option} | awk '/Mem:/ {print $2}')
physmemused=$(free ${option} | awk '/Mem:/ {print $3}')
physmemfree=$(free ${option} | awk '/Mem:/ {print $4}')
swaptotal=$(free ${option} | | awk '/Swap:/ {print $2}')
swapused=$(free ${option} | awk '/Swap:/ {print $3}')
swapfree=$(free ${option} | awk '/Swap:/ {print $4}')
# Uptime
uptime=$(</proc/uptime)
@ -87,4 +87,4 @@ if [ -d "${backupdir}" ]; then
# size of most recent backup.
lastbackupsize=$(du -h "${lastbackup}" | awk '{print $1}')
fi
fi

8
functions/fn_install_logs

@ -17,7 +17,7 @@ touch "${consolelog}"
# If a server is source or goldsource create a symbolic link to the game server logs
if [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]; then
if [ ! -h "${rootdir}/log/server" ]; then
ln -sv "${gamelogdir}" "${rootdir}/log/server"
ln -nfsv "${gamelogdir}" "${rootdir}/log/server"
else
echo "Symbolic link ${gamelogdir} => ${rootdir}/log/server already exists!"
fi
@ -28,15 +28,15 @@ if [ "${engine}" == "unreal2" ]||[ "${engine}" == "unity3d" ]; then
fi
if [ "${gamename}" == "7 Days To Die" ]; then
if [ ! -h "${gamelogdir}/output_log.txt" ]; then
ln -sv "${filesdir}/7DaysToDie_Data/output_log.txt" "${gamelogdir}/output_log.txt"
ln -nfsv "${filesdir}/7DaysToDie_Data/output_log.txt" "${gamelogdir}/output_log.txt"
fi
fi
# If server uses SteamCMD create a symbolic link to the Steam logs
if [ -d "${rootdir}/Steam/logs" ]; then
if [ ! -h "${rootdir}/log/steamcmd" ]; then
ln -sv "${rootdir}/Steam/logs" "${rootdir}/log/steamcmd"
ln -nfsv "${rootdir}/Steam/logs" "${rootdir}/log/steamcmd"
else
echo "Symbolic link ${rootdir}/Steam/logs => ${rootdir}/log/steamcmd already exists!"
fi
fi
sleep 1
sleep 1

8
functions/fn_loginstall

@ -17,7 +17,7 @@ touch "${consolelog}"
# If a server is source or goldsource create a symbolic link to the game server logs
if [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]; then
if [ ! -h "${rootdir}/log/server" ]; then
ln -sv "${gamelogdir}" "${rootdir}/log/server"
ln -nfsv "${gamelogdir}" "${rootdir}/log/server"
else
echo "Symbolic link ${gamelogdir} => ${rootdir}/log/server already exists!"
fi
@ -28,15 +28,15 @@ if [ "${engine}" == "unreal2" ]||[ "${engine}" == "unity3d" ]; then
fi
if [ "${gamename}" == "7 Days To Die" ]; then
if [ ! -h "${gamelogdir}/output_log.txt" ]; then
ln -sv "${filesdir}/7DaysToDie_Data/output_log.txt" "${gamelogdir}/output_log.txt"
ln -nfsv "${filesdir}/7DaysToDie_Data/output_log.txt" "${gamelogdir}/output_log.txt"
fi
fi
# If server uses SteamCMD create a symbolic link to the Steam logs
if [ -d "${rootdir}/Steam/logs" ]; then
if [ ! -h "${rootdir}/log/steamcmd" ]; then
ln -sv "${rootdir}/Steam/logs" "${rootdir}/log/steamcmd"
ln -nfsv "${rootdir}/Steam/logs" "${rootdir}/log/steamcmd"
else
echo "Symbolic link ${rootdir}/Steam/logs => ${rootdir}/log/steamcmd already exists!"
fi
fi
sleep 1
sleep 1

22
functions/fn_messages

@ -8,7 +8,7 @@
# Date and servicename for log files.
fn_scriptlog(){
if [ ! -z ${modulename} ]; then
if [[ -n ${modulename} ]]; then
echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${modulename}: ${1}" >> "${scriptlog}"
else
echo -e "$(date '+%b %d %H:%M:%S') ${servicename}: ${1}" >> "${scriptlog}"
@ -17,7 +17,7 @@ fn_scriptlog(){
# [ FAIL ]
fn_printfail(){
if [ ! -z ${modulename} ]; then
if [[ -n ${modulename} ]]; then
echo -en "\r\033[K[\e[0;31m FAIL \e[0m] ${modulename} ${servicename}: $@"
else
echo -en "\r\033[K[\e[0;31m FAIL \e[0m] $@"
@ -25,7 +25,7 @@ fn_printfail(){
}
fn_printfailnl(){
if [ ! -z ${modulename} ]; then
if [[ -n ${modulename} ]]; then
echo -e "\r\033[K[\e[0;31m FAIL \e[0m] ${modulename} ${servicename}: $@"
else
echo -e "\r\033[K[\e[0;31m FAIL \e[0m] $@"
@ -34,7 +34,7 @@ fn_printfailnl(){
# [ OK ]
fn_printok(){
if [ ! -z ${modulename} ]; then
if [[ -n ${modulename} ]]; then
echo -en "\r\033[K[\e[0;32m OK \e[0m] ${modulename} ${servicename}: $@"
else
echo -en "\r\033[K[\e[0;32m OK \e[0m] $@"
@ -42,7 +42,7 @@ fn_printok(){
}
fn_printoknl(){
if [ ! -z ${modulename} ]; then
if [[ -n ${modulename} ]]; then
echo -e "\r\033[K[\e[0;32m OK \e[0m] ${modulename} ${servicename}: $@"
else
echo -e "\r\033[K[\e[0;32m OK \e[0m] $@"
@ -51,7 +51,7 @@ fn_printoknl(){
# [ INFO ]
fn_printinfo(){
if [ ! -z ${modulename} ]; then
if [[ -n ${modulename} ]]; then
echo -en "\r\033[K[\e[0;36m INFO \e[0m] ${modulename} ${servicename}: $@"
else
echo -en "\r\033[K[\e[0;36m INFO \e[0m] $@"
@ -59,7 +59,7 @@ fn_printinfo(){
}
fn_printinfonl(){
if [ ! -z ${modulename} ]; then
if [[ -n ${modulename} ]]; then
echo -e "\r\033[K[\e[0;36m INFO \e[0m] ${modulename} ${servicename}: $@"
else
echo -e "\r\033[K[\e[0;36m INFO \e[0m] $@"
@ -68,7 +68,7 @@ fn_printinfonl(){
# [ WARN ]
fn_printwarn(){
if [ ! -z ${modulename} ]; then
if [[ -n ${modulename} ]]; then
echo -en "\r\033[K[\e[1;33m WARN \e[0m] ${modulename} ${servicename}: $@"
else
echo -en "\r\033[K[\e[1;33m WARN \e[0m] $@"
@ -76,7 +76,7 @@ fn_printwarn(){
}
fn_printwarnnl(){
if [ ! -z ${modulename} ]; then
if [[ -n ${modulename} ]]; then
echo -e "\r\033[K[\e[1;33m WARN \e[0m] ${modulename} ${servicename}: $@"
else
echo -e "\r\033[K[\e[1;33m WARN \e[0m] $@"
@ -85,7 +85,7 @@ fn_printwarnnl(){
# [ .... ]
fn_printdots(){
if [ ! -z ${modulename} ]; then
if [[ -n ${modulename} ]]; then
echo -en "\r\033[K[ .... ] ${modulename} ${servicename}: $@"
else
echo -en "\r\033[K[ .... ] $@"
@ -126,4 +126,4 @@ fn_printerror(){
fn_printerrornl(){
echo -e "\e[0;31mError!\e[0m $@"
}
}

4
functions/fn_unreal2compressmaps

@ -27,7 +27,7 @@ done
mkdir -pv "${compressedmapsdir}" > /dev/null 2>&1
rm -rfv "${filesdir}/Maps/*.uz2"
cd "${systemdir}"
for map in `ls "${filesdir}/Maps"`; do
for map in "${filesdir}/Maps/*"; do
./ucc-bin compress "../Maps/${map}" --nohomedir
done
mv -fv "${filesdir}/Maps/*.uz2" "${compressedmapsdir}"
mv -fv "${filesdir}/Maps/*.uz2" "${compressedmapsdir}"

4
functions/fn_ut99compressmaps

@ -27,7 +27,7 @@ done
mkdir -pv "${compressedmapsdir}" > /dev/null 2>&1
rm -rfv "${filesdir}/Maps/*.unr.uz"
cd "${systemdir}"
for map in `ls "${filesdir}/Maps"`; do
for map in "${filesdir}/Maps/*"; do
./ucc-bin compress ../Maps/${map} --nohomedir
done
mv -fv "${filesdir}/Maps/*.unr.uz" "${compressedmapsdir}"
mv -fv "${filesdir}/Maps/*.unr.uz" "${compressedmapsdir}"

Loading…
Cancel
Save