fn_debugserver 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #!/bin/bash
  2. # LGSM fn_debugserver function
  3. # Author: Daniel Gibbs
  4. # Website: http://danielgibbs.co.uk
  5. # Version: 010115
  6. # Description: Runs the server without tmux. Runs direct from the terminal.
  7. local modulename="Debug"
  8. fn_rootcheck
  9. fn_syscheck
  10. fn_autoip
  11. fn_distro
  12. fn_uptime
  13. fn_load
  14. fn_parms
  15. echo ""
  16. echo "${gamename} Debug"
  17. echo "============================"
  18. echo ""
  19. echo -e "Distro: ${os}"
  20. echo -e "Arch: ${arch}"
  21. echo -e "Kernel: ${kernel}"
  22. echo -e "Hostname: $HOSTNAME"
  23. echo ""
  24. echo "Start parameters:"
  25. if [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]; then
  26. echo "${executable} ${parms} -debug"
  27. else
  28. echo "${executable} ${parms}"
  29. fi
  30. echo ""
  31. echo -e "Use for identifying server issues only!"
  32. echo -e "Press CTRL+c to drop out of debug mode."
  33. fn_printwarningnl "If ${servicename} is already running it will be stopped."
  34. echo ""
  35. while true; do
  36. read -p "Continue? [y/N]" yn
  37. case $yn in
  38. [Yy]* ) break;;
  39. [Nn]* ) echo Exiting; return 1;;
  40. * ) echo "Please answer yes or no.";;
  41. esac
  42. done
  43. fn_scriptlog "Starting debug"
  44. fn_printinfonl "Stopping any running servers"
  45. fn_scriptlog "Stopping any running servers"
  46. sleep 1
  47. fn_stopserver
  48. fn_printdots "Starting debug"
  49. sleep 1
  50. fn_printok "Starting debug"
  51. fn_scriptlog "Started debug"
  52. sleep 1
  53. echo -en "\n"
  54. cd "${executabledir}"
  55. if [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]; then
  56. ${executable} ${parms} -debug
  57. else
  58. ${executable} ${parms}
  59. fi