command_debug.sh 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #!/bin/bash
  2. # LGSM command_debug.sh function
  3. # Author: Daniel Gibbs
  4. # Website: https://gameservermanagers.com
  5. lgsm_version="210516"
  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_print_warning_nl "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_script_log "Starting debug"
  42. fn_print_info_nl "Stopping any running servers"
  43. fn_script_log "Stopping any running servers"
  44. sleep 1
  45. command_stop.sh
  46. fn_print_dots "Starting debug"
  47. sleep 1
  48. fn_print_ok_nl "Starting debug"
  49. fn_script_log "Started debug"
  50. cd "${executabledir}"
  51. fix.sh
  52. if [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]; then
  53. ${executable} ${parms} -debug
  54. else
  55. ${executable} ${parms}
  56. fi