illwieckz

dedmgr

Feb 14th, 2021 (edited)
347
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. #! /bin/sh -x
  2.  
  3. cd
  4.  
  5. start_game () {
  6. case "${1}" in
  7. 'unvanquished'|'unvtrem'|'unvmaster')
  8. sudo -H -u unvanquished ~/startded "${1}"
  9. ;;
  10. 'gesource')
  11. sudo -H -u gesource ~/startded "${1}"
  12. ;;
  13. 'pdsource')
  14. sudo -H -u pdsource ~/startded "${1}"
  15. ;;
  16. 'etlegacy'|'cqbtest'|'tcetestobj'|'tcetestbc')
  17. sudo -H -u etlegacy ~/startded "${1}"
  18. ;;
  19. 'xonotic'|'xonduel')
  20. sudo -H -u xonotic ~/startded "${1}"
  21. ;;
  22. 'smokinguns')
  23. sudo -H -u smokinguns ~/startded "${1}"
  24. ;;
  25. 'chatbridge')
  26. sudo -H -u chatbridge ~/startded "${1}"
  27. ;;
  28. *)
  29. ;;
  30. esac
  31. }
  32.  
  33. parse () {
  34. keyword="$(echo "${1}" | cut -f1 -d' ')"
  35. game="$(echo "${1}" | cut -f2 -d' ')"
  36. case "${keyword}" in
  37. 'start')
  38. start_game "${game}"
  39. ;;
  40. *)
  41. ;;
  42. esac
  43. }
  44.  
  45. main () {
  46. while true
  47. do
  48. netcat -l -p 2828 | while read line
  49. do
  50. parse "${line}"
  51. done
  52. done
  53. }
  54.  
  55. touch -a ~/dedmgr.log
  56. main | tee -a ~/dedmgr.log
  57.  
  58. #EOF
Add Comment
Please, Sign In to add comment