athena-start 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #!/bin/sh
  2. # athena starting script by rowla
  3. # modified by shazeya@syafi.com (NL101541)
  4. PATH=./:$PATH
  5. L_SRV=login-server_sql
  6. C_SRV=char-server_sql
  7. M_SRV=map-server_sql
  8. print_start() {
  9. # more << EOF
  10. echo "Athena Starting..."
  11. echo " (c) 2003 Athena Project"
  12. echo " modified by shazeya@syafi.com"
  13. echo ""
  14. #echo "Debug informations will appear,"
  15. #echo "since this is a test release."
  16. #echo ""
  17. echo "checking..."
  18. #EOF
  19. }
  20. check_files() {
  21. for i in ${L_SRV} ${C_SRV} ${M_SRV}
  22. do
  23. if [ ! -f ./$i ]; then
  24. echo "$i does not exist, or can't run."
  25. echo "Stop. Check your compile."
  26. exit 1;
  27. fi
  28. done
  29. # more << EOF
  30. echo "Check complete."
  31. echo "Looks good, a nice Athena!"
  32. #EOF
  33. }
  34. case $1 in
  35. 'start')
  36. print_start
  37. check_files
  38. exec ./${L_SRV}&
  39. exec ./${C_SRV}&
  40. exec ./${M_SRV}&
  41. echo "Now Started Athena."
  42. ;;
  43. 'stop')
  44. ps ax | grep -E "${L_SRV}|${C_SRV}|${M_SRV}" | awk '{print $1}' | xargs kill
  45. ;;
  46. 'restart')
  47. $0 stop
  48. $0 start
  49. ;;
  50. *)
  51. echo "Usage: athena-start { start | stop | restart }"
  52. ;;
  53. esac