fn_debugserver 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #!/bin/bash
  2. # LGSM fn_debugserver function
  3. # Author: Daniel Gibbs
  4. # Website: http://danielgibbs.co.uk
  5. # Version: 121114
  6. fn_rootcheck
  7. fn_syscheck
  8. fn_autoip
  9. fn_distro
  10. fn_uptime
  11. fn_load
  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. echo ${executable} ${parms}
  24. echo ""
  25. echo -e "Use for identifying server issues only!"
  26. echo -e "Press CTRL+c to drop out of debug mode"
  27. echo -e "\e[0;31mWARNING!\e[0;39m If ${servicename} is already running it will be stopped"
  28. echo ""
  29. while true; do
  30. read -p "Continue? [y/N]" yn
  31. case $yn in
  32. [Yy]* ) break;;
  33. [Nn]* ) echo Exiting; return 1;;
  34. * ) echo "Please answer yes or no.";;
  35. esac
  36. done
  37. fn_stopserver
  38. fn_printdots "Starting debug mode ${servicename}: ${servername}"
  39. sleep 1
  40. fn_printok "Starting debug mode ${servicename}: ${servername}"
  41. sleep 1
  42. fn_scriptlog "Started debug mode ${servername}"
  43. echo -en "\n"
  44. cd "${executabledir}"
  45. if [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]; then
  46. ${executable} ${parms} -debug
  47. else
  48. ${executable} ${parms}
  49. fi