command_debug.sh 1.6 KB

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