fn_debugserver 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #!/bin/bash
  2. # LGSM fn_debugserver function
  3. # Author: Daniel Gibbs
  4. # Website: http://danielgibbs.co.uk
  5. # Version: 140115
  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_distrodetails
  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 -p "Continue? [y/N]" yn
  35. case $yn in
  36. [Yy]* ) break;;
  37. [Nn]* ) echo Exiting; return 1;;
  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. fn_stopserver
  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. if [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]; then
  54. ${executable} ${parms} -debug
  55. else
  56. ${executable} ${parms}
  57. fi