command_debug.sh 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. #!/bin/bash
  2. # LGSM command_debug.sh function
  3. # Author: Daniel Gibbs
  4. # Website: http://gameservermanagers.com
  5. lgsm_version="271215"
  6. # Description: Runs the server without tmux. Runs direct from the terminal.
  7. local modulename="Debug"
  8. function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
  9. check.sh
  10. info_distro.sh
  11. fn_parms
  12. echo ""
  13. echo "${gamename} Debug"
  14. echo "============================"
  15. echo ""
  16. echo -e "Distro: ${os}"
  17. echo -e "Arch: ${arch}"
  18. echo -e "Kernel: ${kernel}"
  19. echo -e "Hostname: $HOSTNAME"
  20. echo ""
  21. echo "Start parameters:"
  22. if [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]; then
  23. echo "${executable} ${parms} -debug"
  24. else
  25. echo "${executable} ${parms}"
  26. fi
  27. echo ""
  28. echo -e "Use for identifying server issues only!"
  29. echo -e "Press CTRL+c to drop out of debug mode."
  30. fn_printwarningnl "If ${servicename} is already running it will be stopped."
  31. echo ""
  32. while true; do
  33. read -e -i "y" -p "Continue? [Y/n]" yn
  34. case $yn in
  35. [Yy]* ) break;;
  36. [Nn]* ) echo Exiting; return;;
  37. * ) echo "Please answer yes or no.";;
  38. esac
  39. done
  40. fn_scriptlog "Starting debug"
  41. fn_printinfonl "Stopping any running servers"
  42. fn_scriptlog "Stopping any running servers"
  43. sleep 1
  44. command_stop.sh
  45. fn_printdots "Starting debug"
  46. sleep 1
  47. fn_printok "Starting debug"
  48. fn_scriptlog "Started debug"
  49. sleep 1
  50. echo -en "\n"
  51. cd "${executabledir}"
  52. if [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]; then
  53. if [ "${gamename}" == "Counter Strike: Global Offensive" ]; then
  54. startfix=1
  55. fix_csgo.sh
  56. elif [ "${gamename}" == "Insurgency" ]; then
  57. fix_ins.sh
  58. elif [ "${gamename}" == "ARMA 3" ]; then
  59. fix_arma3.sh
  60. fi
  61. ${executable} ${parms} -debug
  62. else
  63. ${executable} ${parms}
  64. fi