Просмотр исходного кода

Initial renaming

creating new branch to test renaming
Daniel Gibbs 10 лет назад
Родитель
Сommit
860126bf7d
63 измененных файлов с 127 добавлено и 24 удалено
  1. 1 4
      CounterStrikeGlobalOffensive/csgoserver
  2. 35 0
      functions/check.sh
  3. 0 0
      functions/check_ip.sh
  4. 0 0
      functions/check_logs.sh
  5. 1 1
      functions/check_root.sh
  6. 0 0
      functions/check_steamcmd.sh
  7. 0 0
      functions/check_steamuser.sh
  8. 1 1
      functions/check_systemdir.sh
  9. 0 0
      functions/check_tmux.sh
  10. 1 1
      functions/command_backup.sh
  11. 1 1
      functions/command_console.sh
  12. 1 1
      functions/command_debug
  13. 68 0
      functions/command_debug.sh
  14. 0 0
      functions/command_details.sh
  15. 1 1
      functions/command_install.sh
  16. 2 2
      functions/command_monitor.sh
  17. 2 2
      functions/command_start.sh
  18. 2 2
      functions/command_stop.sh
  19. 0 0
      functions/command_update.sh
  20. 0 0
      functions/command_validate.sh
  21. 1 1
      functions/compress_unreal2_maps.sh
  22. 1 1
      functions/compress_ut99_maps.sh
  23. 1 1
      functions/core_functions.sh
  24. 0 0
      functions/core_getopt.sh
  25. 4 1
      functions/core_messages.sh
  26. 0 0
      functions/dev_debug.sh
  27. 1 1
      functions/dev_detect_deps.sh
  28. 0 0
      functions/email.sh
  29. 1 1
      functions/email_test.sh
  30. 0 0
      functions/fix_arma3.sh
  31. 0 0
      functions/fix_csgo.sh
  32. 0 0
      functions/fix_glibc.sh
  33. 0 0
      functions/fix_ins.sh
  34. 0 0
      functions/info_config.sh
  35. 0 0
      functions/info_distro.sh
  36. 0 0
      functions/info_glibc.sh
  37. 0 0
      functions/info_ts3status.sh
  38. 0 0
      functions/install_complete.sh
  39. 0 0
      functions/install_config.sh
  40. 0 0
      functions/install_dl_ut2k4.sh
  41. 0 0
      functions/install_dl_ut99.sh
  42. 0 0
      functions/install_fix_kf.sh
  43. 0 0
      functions/install_fix_ro.sh
  44. 0 0
      functions/install_fix_steam.sh
  45. 0 0
      functions/install_fix_ut2k4.sh
  46. 0 0
      functions/install_fix_ut99.sh
  47. 0 0
      functions/install_gslt.sh
  48. 0 0
      functions/install_gsquery.sh
  49. 0 0
      functions/install_header.sh
  50. 0 0
      functions/install_logs.sh
  51. 0 0
      functions/install_retry.sh
  52. 0 0
      functions/install_serverdir.sh
  53. 0 0
      functions/install_serverfiles.sh
  54. 0 0
      functions/install_steamcmd.sh
  55. 0 0
      functions/install_ts3
  56. 0 0
      functions/install_ut2k4.sh
  57. 0 0
      functions/install_ut2k4_key.sh
  58. 0 0
      functions/install_ut99.sh
  59. 0 0
      functions/logs.sh
  60. 0 0
      functions/monitor_gsquery.sh
  61. 0 0
      functions/update_check.sh
  62. 2 2
      functions/update_dl.sh
  63. 0 0
      functions/update_functions.sh

+ 1 - 4
CounterStrikeGlobalOffensive/csgoserver

@@ -155,7 +155,4 @@ functionfile="${FUNCNAME}"
 fn_runfunction
 fn_runfunction
 }
 }
 
 
-fn_functions
-
-getopt=$1
-fn_getopt
+core_functions.sh

+ 35 - 0
functions/check.sh

@@ -0,0 +1,35 @@
+#!/bin/bash
+# LGSM fn_check function
+# Author: Daniel Gibbs
+# Website: http://gameservermanagers.com
+lgsm_version="201215"
+
+# Description: Overall function for managing checks.
+# Runs checks that will either halt on or fix an issue.
+
+fn_module_compare() {
+  local e
+  for e in "${@:2}"; do [[ "$e" == "$1" ]] && return 0; done
+  return 1
+}
+
+
+check_root.sh
+
+if [ "${module}" != "install" ]; then
+	check_executable.sh
+fi
+
+no_check_logs=( details install map-compressor)
+fn_module_compare "${module}" "${no_check_logs[@]}"
+if [ $? != 0 ]; then
+	fn_check_logs
+fi
+
+
+fn_check_ip
+fn_check_steamcmd
+fn_check_steamuser
+fn_check_tmux
+
+fn_check_ts3status # may need to move out of checks

+ 0 - 0
functions/fn_check_ip → functions/check_ip.sh


+ 0 - 0
functions/fn_check_logs → functions/check_logs.sh


+ 1 - 1
functions/fn_check_root → functions/check_root.sh

@@ -1,5 +1,5 @@
 #!/bin/bash
 #!/bin/bash
-# LGSM fn_check_root function
+# LGSM check_root.sh function
 # Author: Daniel Gibbs
 # Author: Daniel Gibbs
 # Website: http://gameservermanagers.com
 # Website: http://gameservermanagers.com
 lgsm_version="061115"
 lgsm_version="061115"

+ 0 - 0
functions/fn_check_steamcmd → functions/check_steamcmd.sh


+ 0 - 0
functions/fn_check_steamuser → functions/check_steamuser.sh


+ 1 - 1
functions/fn_check_systemdir → functions/check_systemdir.sh

@@ -4,7 +4,7 @@
 # Website: http://gameservermanagers.com
 # Website: http://gameservermanagers.com
 lgsm_version="061115"
 lgsm_version="061115"
 
 
-if [ ! -e "${systemdir}" ]; then
+if [ ! -f "${systemdir}" ]; then
 	fn_printfailnl "Cannot access ${systemdir}: No such directory"
 	fn_printfailnl "Cannot access ${systemdir}: No such directory"
 	exit 1
 	exit 1
 fi
 fi

+ 0 - 0
functions/fn_check_tmux → functions/check_tmux.sh


+ 1 - 1
functions/fn_backup → functions/command_backup.sh

@@ -7,7 +7,7 @@ lgsm_version="201215"
 # Description: Creates a .tar.gz file in the backup directory.
 # Description: Creates a .tar.gz file in the backup directory.
 
 
 local modulename="Backup"
 local modulename="Backup"
-fn_check_root
+check_root.sh
 fn_check_systemdir
 fn_check_systemdir
 backupname="${servicename}-$(date '+%Y-%m-%d-%H%M%S')"
 backupname="${servicename}-$(date '+%Y-%m-%d-%H%M%S')"
 echo ""
 echo ""

+ 1 - 1
functions/fn_console → functions/command_console.sh

@@ -7,7 +7,7 @@ lgsm_version="061115"
 # Description: Gives access to the server tmux console.
 # Description: Gives access to the server tmux console.
 
 
 local modulename="Console"
 local modulename="Console"
-fn_check_root
+check_root.sh
 fn_check_systemdir
 fn_check_systemdir
 echo ""
 echo ""
 echo "${gamename} Console"
 echo "${gamename} Console"

+ 1 - 1
functions/fn_debug → functions/command_debug

@@ -7,7 +7,7 @@ lgsm_version="061115"
 # Description: Runs the server without tmux. Runs direct from the terminal.
 # Description: Runs the server without tmux. Runs direct from the terminal.
 
 
 local modulename="Debug"
 local modulename="Debug"
-fn_check_root
+check_root.sh
 fn_check_systemdir
 fn_check_systemdir
 fn_check_ip
 fn_check_ip
 fn_check_logs
 fn_check_logs

+ 68 - 0
functions/command_debug.sh

@@ -0,0 +1,68 @@
+#!/bin/bash
+# LGSM fn_debug function
+# Author: Daniel Gibbs
+# Website: http://gameservermanagers.com
+lgsm_version="061115"
+
+# Description: Runs the server without tmux. Runs direct from the terminal.
+
+local modulename="Debug"
+check_root.sh
+fn_check_systemdir
+fn_check_ip
+fn_check_logs
+fn_details_distro
+fn_parms
+echo ""
+echo "${gamename} Debug"
+echo "============================"
+echo ""
+echo -e "Distro: ${os}"
+echo -e "Arch: ${arch}"
+echo -e "Kernel: ${kernel}"
+echo -e "Hostname: $HOSTNAME"
+echo ""
+echo "Start parameters:"
+if [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]; then
+	echo "${executable} ${parms} -debug"
+else
+	echo "${executable} ${parms}"
+fi
+echo ""
+echo -e "Use for identifying server issues only!"
+echo -e "Press CTRL+c to drop out of debug mode."
+fn_printwarningnl "If ${servicename} is already running it will be stopped."
+echo ""
+while true; do
+	read -e -i "y" -p "Continue? [Y/n]" yn
+	case $yn in
+	[Yy]* ) break;;
+	[Nn]* ) echo Exiting; return;;
+	* ) echo "Please answer yes or no.";;
+esac
+done
+fn_scriptlog "Starting debug"
+fn_printinfonl "Stopping any running servers"
+fn_scriptlog "Stopping any running servers"
+sleep 1
+fn_stop
+fn_printdots "Starting debug"
+sleep 1
+fn_printok "Starting debug"
+fn_scriptlog "Started debug"
+sleep 1
+echo -en "\n"
+cd "${executabledir}"
+if [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]; then
+	if [ "${gamename}" == "Counter Strike: Global Offensive" ]; then
+		startfix=1
+		fn_csgofix
+	elif [ "${gamename}" == "Insurgency" ]; then
+		fn_insfix
+	elif [ "${gamename}" == "ARMA 3" ]; then
+		fn_arma3fix	
+	fi
+	${executable} ${parms} -debug
+else
+	${executable} ${parms}
+fi

+ 0 - 0
functions/fn_details → functions/command_details.sh


+ 1 - 1
functions/fn_install → functions/command_install.sh

@@ -4,7 +4,7 @@
 # Website: http://gameservermanagers.com
 # Website: http://gameservermanagers.com
 lgsm_version="201215"
 lgsm_version="201215"
 
 
-fn_check_root
+check_root.sh
 fn_install_header
 fn_install_header
 fn_install_serverdir
 fn_install_serverdir
 
 

+ 2 - 2
functions/fn_monitor → functions/command_monitor.sh

@@ -10,7 +10,7 @@ lgsm_version="061115"
 local modulename="Monitor"
 local modulename="Monitor"
 
 
 fn_monitor_teamspeak3(){
 fn_monitor_teamspeak3(){
-fn_check_root
+check_root.sh
 fn_check_systemdir
 fn_check_systemdir
 fn_logs
 fn_logs
 fn_printdots "${servername}"
 fn_printdots "${servername}"
@@ -54,7 +54,7 @@ fn_restart
 }
 }
 
 
 fn_monitor_tmux(){
 fn_monitor_tmux(){
-fn_check_root
+check_root.sh
 fn_check_systemdir
 fn_check_systemdir
 fn_check_ip
 fn_check_ip
 fn_details_config
 fn_details_config

+ 2 - 2
functions/fn_start → functions/command_start.sh

@@ -9,7 +9,7 @@ lgsm_version="201215"
 local modulename="Starting"
 local modulename="Starting"
 
 
 fn_start_teamspeak3(){
 fn_start_teamspeak3(){
-fn_check_root
+check_root.sh
 fn_check_systemdir
 fn_check_systemdir
 fn_check_logs
 fn_check_logs
 fn_check_ts3status
 fn_check_ts3status
@@ -73,7 +73,7 @@ echo -en "\n"
 }
 }
 
 
 fn_start_tmux(){
 fn_start_tmux(){
-fn_check_root
+check_root.sh
 fn_check_systemdir
 fn_check_systemdir
 fn_check_ip
 fn_check_ip
 fn_check_logs
 fn_check_logs

+ 2 - 2
functions/fn_stop → functions/command_stop.sh

@@ -29,7 +29,7 @@ sdtd_telnet(){
 }
 }
 
 
 fn_stop_teamspeak3(){
 fn_stop_teamspeak3(){
-fn_check_root
+check_root.sh
 fn_check_systemdir
 fn_check_systemdir
 fn_printdots "${servername}"
 fn_printdots "${servername}"
 fn_scriptlog "${servername}"
 fn_scriptlog "${servername}"
@@ -50,7 +50,7 @@ echo -en "\n"
 }
 }
 
 
 fn_stop_tmux(){
 fn_stop_tmux(){
-fn_check_root
+check_root.sh
 fn_check_systemdir
 fn_check_systemdir
 fn_details_config
 fn_details_config
 fn_printdots "${servername}"
 fn_printdots "${servername}"

+ 0 - 0
functions/command_update.sh


+ 0 - 0
functions/fn_validate → functions/command_validate.sh


+ 1 - 1
functions/fn_compress_unreal2maps → functions/compress_unreal2_maps.sh

@@ -4,7 +4,7 @@
 # Website: http://gameservermanagers.com
 # Website: http://gameservermanagers.com
 lgsm_version="061115"
 lgsm_version="061115"
 
 
-fn_check_root
+check_root.sh
 clear
 clear
 echo "${gamename} Map Compressor"
 echo "${gamename} Map Compressor"
 echo "============================"
 echo "============================"

+ 1 - 1
functions/fn_compress_ut99maps → functions/compress_ut99_maps.sh

@@ -4,7 +4,7 @@
 # Website: http://gameservermanagers.com
 # Website: http://gameservermanagers.com
 lgsm_version="061115"
 lgsm_version="061115"
 
 
-fn_check_root
+check_root.sh
 clear
 clear
 echo "${gamename} Map Compressor"
 echo "${gamename} Map Compressor"
 echo "============================"
 echo "============================"

+ 1 - 1
functions/fn_functions → functions/core_functions.sh

@@ -27,7 +27,7 @@ functionfile="${FUNCNAME}"
 fn_runfunction
 fn_runfunction
 }
 }
 
 
-fn_check_root(){
+check_root.sh(){
 functionfile="${FUNCNAME}"
 functionfile="${FUNCNAME}"
 fn_runfunction
 fn_runfunction
 }
 }

+ 0 - 0
functions/fn_getopt → functions/core_getopt.sh


+ 4 - 1
functions/fn_messages → functions/core_messages.sh

@@ -145,4 +145,7 @@ fn_printokeol(){
 # FAIL for end of line
 # FAIL for end of line
 fn_printfaileol(){
 fn_printfaileol(){
 	echo -e "\e[0;31mFAIL\e[0m\n"
 	echo -e "\e[0;31mFAIL\e[0m\n"
-}
+}
+
+getopt=$1
+core_getopt.sh

+ 0 - 0
functions/fn_debug_dev → functions/dev_debug.sh


+ 1 - 1
functions/fn_deps_detect → functions/dev_detect_deps.sh

@@ -7,7 +7,7 @@ lgsm_version="201215"
 # Description: Detects dependencies the server binary requires.
 # Description: Detects dependencies the server binary requires.
 
 
 local modulename="Backup"
 local modulename="Backup"
-fn_check_root
+check_root.sh
 fn_check_systemdir
 fn_check_systemdir
 cd "${executabledir}"
 cd "${executabledir}"
 if [ "${executable}" ==  "./hlds_run" ]; then
 if [ "${executable}" ==  "./hlds_run" ]; then

+ 0 - 0
functions/fn_email → functions/email.sh


+ 1 - 1
functions/fn_email_test → functions/email_test.sh

@@ -7,7 +7,7 @@ lgsm_version="061115"
 # Description: Sends a test email notification.
 # Description: Sends a test email notification.
 
 
 local modulename="Email"
 local modulename="Email"
-fn_check_root
+check_root.sh
 fn_check_systemdir
 fn_check_systemdir
 fn_details_config
 fn_details_config
 if [ "${emailnotification}" = "on" ]; then
 if [ "${emailnotification}" = "on" ]; then

+ 0 - 0
functions/fn_arma3fix → functions/fix_arma3.sh


+ 0 - 0
functions/fn_csgofix → functions/fix_csgo.sh


+ 0 - 0
functions/fn_install_glibcfix → functions/fix_glibc.sh


+ 0 - 0
functions/fn_insfix → functions/fix_ins.sh


+ 0 - 0
functions/fn_details_config → functions/info_config.sh


+ 0 - 0
functions/fn_details_distro → functions/info_distro.sh


+ 0 - 0
functions/fn_details_glibc → functions/info_glibc.sh


+ 0 - 0
functions/fn_check_ts3status → functions/info_ts3status.sh


+ 0 - 0
functions/fn_install_complete → functions/install_complete.sh


+ 0 - 0
functions/fn_install_config → functions/install_config.sh


+ 0 - 0
functions/fn_install_ut2k4filesdl → functions/install_dl_ut2k4.sh


+ 0 - 0
functions/fn_install_ut99filesdl → functions/install_dl_ut99.sh


+ 0 - 0
functions/fn_install_kffix → functions/install_fix_kf.sh


+ 0 - 0
functions/fn_install_rofix → functions/install_fix_ro.sh


+ 0 - 0
functions/fn_install_steamfix → functions/install_fix_steam.sh


+ 0 - 0
functions/fn_install_ut2k4fix → functions/install_fix_ut2k4.sh


+ 0 - 0
functions/fn_install_ut99fix → functions/install_fix_ut99.sh


+ 0 - 0
functions/fn_install_gslt → functions/install_gslt.sh


+ 0 - 0
functions/fn_install_gsquery → functions/install_gsquery.sh


+ 0 - 0
functions/fn_install_header → functions/install_header.sh


+ 0 - 0
functions/fn_install_logs → functions/install_logs.sh


+ 0 - 0
functions/fn_install_retry → functions/install_retry.sh


+ 0 - 0
functions/fn_install_serverdir → functions/install_serverdir.sh


+ 0 - 0
functions/fn_install_serverfiles → functions/install_serverfiles.sh


+ 0 - 0
functions/fn_install_steamcmd → functions/install_steamcmd.sh


+ 0 - 0
functions/fn_install_ts3 → functions/install_ts3


+ 0 - 0
functions/fn_install_ut2k4 → functions/install_ut2k4.sh


+ 0 - 0
functions/fn_install_ut2k4key → functions/install_ut2k4_key.sh


+ 0 - 0
functions/fn_install_ut99 → functions/install_ut99.sh


+ 0 - 0
functions/fn_logs → functions/logs.sh


+ 0 - 0
functions/fn_monitor_query → functions/monitor_gsquery.sh


+ 0 - 0
functions/fn_update_check → functions/update_check.sh


+ 2 - 2
functions/fn_update_dl → functions/update_dl.sh

@@ -9,7 +9,7 @@ lgsm_version="061115"
 local modulename="Update"
 local modulename="Update"
 
 
 fn_steamcmd_dl(){
 fn_steamcmd_dl(){
-fn_check_root
+check_root.sh
 fn_check_systemdir
 fn_check_systemdir
 fn_details_config
 fn_details_config
 fn_printdots "Updating ${servername}"
 fn_printdots "Updating ${servername}"
@@ -39,7 +39,7 @@ fi
 }
 }
 
 
 fn_teamspeak3_dl(){
 fn_teamspeak3_dl(){
-fn_check_root
+check_root.sh
 fn_check_systemdir
 fn_check_systemdir
 fn_details_config
 fn_details_config
 fn_printdots "Updating ${servername}"
 fn_printdots "Updating ${servername}"

+ 0 - 0
functions/fn_update_functions → functions/update_functions.sh