command_debug.sh 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. fix.sh
  11. info_distro.sh
  12. fn_parms
  13. echo ""
  14. echo "${gamename} Debug"
  15. echo "============================"
  16. echo ""
  17. echo -e "Distro: ${os}"
  18. echo -e "Arch: ${arch}"
  19. echo -e "Kernel: ${kernel}"
  20. echo -e "Hostname: $HOSTNAME"
  21. echo ""
  22. echo "Start parameters:"
  23. if [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]; then
  24. echo "${executable} ${parms} -debug"
  25. else
  26. echo "${executable} ${parms}"
  27. fi
  28. echo ""
  29. echo -e "Use for identifying server issues only!"
  30. echo -e "Press CTRL+c to drop out of debug mode."
  31. fn_printwarningnl "If ${servicename} is already running it will be stopped."
  32. echo ""
  33. while true; do
  34. read -e -i "y" -p "Continue? [Y/n]" yn
  35. case $yn in
  36. [Yy]* ) break;;
  37. [Nn]* ) echo Exiting; return;;
  38. * ) echo "Please answer yes or no.";;
  39. esac
  40. done
  41. fn_scriptlog "Starting debug"
  42. fn_printinfonl "Stopping any running servers"
  43. fn_scriptlog "Stopping any running servers"
  44. sleep 1
  45. command_stop.sh
  46. fn_printdots "Starting debug"
  47. sleep 1
  48. fn_printok "Starting debug"
  49. fn_scriptlog "Started debug"
  50. sleep 1
  51. echo -en "\n"
  52. cd "${executabledir}"
  53. fix.sh
  54. if [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]; then
  55. ${executable} ${parms} -debug
  56. else
  57. ${executable} ${parms}
  58. fi