get-updates.sh 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. #!/bin/bash
  2. RED=$(tput setaf 1)
  3. NC=$(tput sgr0) # No Color
  4. exec 0</dev/tty
  5. source .env
  6. clear
  7. echo ""
  8. echo "Compiling all code now."
  9. echo ""
  10. echo ""
  11. ant -f server/build.xml compile_core
  12. ant -f server/build.xml compile_plugins
  13. ant -f Client_Base/build.xml compile
  14. ant -f PC_Launcher/build.xml compile
  15. # Launcher
  16. echo ""
  17. echo "Copy and md5sum compiled client and cache files to the Website downloads folder?
  18. Choices:
  19. ${RED}1${NC} - No
  20. ${RED}2${NC} - Yes (prod)"
  21. echo ""
  22. echo "Type the choice number and press enter."
  23. echo ""
  24. read -r compiling
  25. if [ "$compiling" == "1" ]; then
  26. echo ""
  27. elif [ "$compiling" == "2" ]; then
  28. # PC Client
  29. yes | sudo cp -f Client_Base/*.jar ../Website/portal/public/downloads/
  30. # Launcher
  31. yes | sudo cp -rf PC_Launcher/*.jar ../Website/portal/public/downloads/
  32. # Set file permissions within the Website downloads folder
  33. sudo chmod +x ../Website/portal/public/downloads/*.jar
  34. # Cache copy and file permissions
  35. yes | sudo cp -a -rf "Client_Base/Cache/." "../Website/portal/public/downloads/"
  36. cd '../Website/portal/public/downloads/' || exit
  37. # Performs md5 hashing of all files in cache and writes to a text file for the launcher to read
  38. find -type f \( -not -name "MD5.SUM" \) -exec md5sum '{}' \; >MD5.SUM
  39. cd '../../../../Game' || exit
  40. fi
  41. clear
  42. # Finished
  43. echo ""
  44. echo "What would you like to do?
  45. Choices:
  46. ${RED}1${NC} - Run game server
  47. ${RED}Ctrl+C${NC} - Exit"
  48. echo ""
  49. echo "Type the choice number and press enter."
  50. echo ""
  51. read -r finished
  52. if [ "$finished" == "1" ]; then
  53. make run-server
  54. else
  55. exit
  56. fi