fn_debug 1.5 KB

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