command_debug.sh 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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_root.sh
  9. check_systemdir.sh
  10. check_ip.sh
  11. check_logs.sh
  12. info_distro.sh
  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 -e -i "y" -p "Continue? [Y/n]" yn
  36. case $yn in
  37. [Yy]* ) break;;
  38. [Nn]* ) echo Exiting; return;;
  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. command_stop.sh
  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}" == "Counter Strike: Global Offensive" ]; then
  56. startfix=1
  57. fix_csgo.sh
  58. elif [ "${gamename}" == "Insurgency" ]; then
  59. fix_ins.sh
  60. elif [ "${gamename}" == "ARMA 3" ]; then
  61. fix_arma3.sh
  62. fi
  63. ${executable} ${parms} -debug
  64. else
  65. ${executable} ${parms}
  66. fi