Bubble proxy service
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

38 рядки
1.2 KiB

  1. #!/bin/bash
  2. #
  3. # Install bubble-flexrouter on Mac OS X as a LaunchDaemon
  4. #
  5. FR_DIST_TMP_DIR=$(mktemp -d /tmp/bubble-flexrouter.XXXXXXX)
  6. FR_DIST_TMP_ZIP=${FR_DIST_TMP_DIR}/bubble-flexrouter.zip
  7. function die {
  8. echo 1>&2 "${1}"
  9. rm -rf ${FR_DIST_TMP_DIR}
  10. exit 1
  11. }
  12. # Set by jenkins when dist zip file is created
  13. FR_DIST_VERSION="@@FR_DIST_VERSION@@"
  14. FR_DIST_SHA="@@FR_DIST_SHA@@"
  15. FR_DIST_URL="https://jenkins.bubblev.org/public/releases/bubble-flexrouter/bubble-flexrouter-macos/@@FR_DIST_VERSION@@/bubble-flexrouter.zip"
  16. # Download the zip file and check the SHA
  17. echo "Downloading bubble-flexrouter..."
  18. curl -s ${FR_DIST_URL} > ${FR_DIST_TMP_ZIP} || die "Error downloading flexrouter zip file from ${FR_DIST_URL}"
  19. FR_ACTUAL_SHA="$(cat ${FR_DIST_TMP} | shasum -a 256 | awk '{print $2}')"
  20. if [[ "${FR_ACTUAL_SHA}" != "${FR_DIST_SHA}" ]] ; then
  21. die "SHA-256 sum did not match. Found ${FR_ACTUAL_SHA} but expected ${FR_DIST_SHA} for ${FR_DIST_URL}"
  22. fi
  23. # Unzip archive to temp dir
  24. echo "Unpacking bubble-flexrouter..."
  25. cd ${FR_DIST_TMP_DIR} && unzip ${FR_DIST_TMP_ZIP} || die "Error unzipping bubble-flexrouter.zip"
  26. cd bubble-flexrouter
  27. # Clean up
  28. # rm -rf ${FR_DIST_TMP_DIR}
  29. echo "bubble-flexrouter successfully installed"