2
0

mint.sh 618 B

12345678910111213141516171819202122232425262728
  1. #!/bin/bash
  2. set -e
  3. # -----------------------------------------------------------------------------
  4. if [[ "$EUID" -ne 0 ]]; then
  5. echo "please run this script as root."
  6. exit 1
  7. fi
  8. . /etc/os-release
  9. if [[ "$ID" != "ubuntu" ]]; then
  10. echo "unsupported distribution $ID"
  11. exit 1
  12. fi
  13. # -----------------------------------------------------------------------------
  14. if [[ "$#" -eq 1 && "$1" == "diagnose" ]]; then
  15. php --version
  16. echo "NodeJs: $(node -v)"
  17. echo "npm: $(npm -v)"
  18. composer diagnose
  19. else
  20. echo "unsupported args, USAGE: $0 diagnose|api-v8 PORT|api-v12 PORT"
  21. exit 1
  22. fi
  23. exit 0