The main Bubble source repository. Contains the Bubble API server, the web UI, documentation and utilities. https://getbubblenow.com
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.

install_cert.sh 986 B

4 yıl önce
4 yıl önce
12345678910111213141516171819202122232425262728293031323334
  1. #!/bin/bash
  2. #
  3. # Copyright (c) 2020 Bubble, Inc. All rights reserved. For personal (non-commercial) use, see license: https://getbubblenow.com/bubble-license/
  4. #
  5. CERT="${1:?no cert provided}"
  6. TIMEOUT=${2:-0}
  7. function die {
  8. echo 1>&2 "${1}"
  9. exit 1
  10. }
  11. START=$(date +%s)
  12. while [[ ! -f "${CERT}" ]] ; do
  13. ELAPSED=$(expr $(date +%s) - ${START})
  14. if [[ ${ELAPSED} -gt ${TIMEOUT} ]] ; then
  15. break
  16. fi
  17. echo "Cert file does not exist, sleeping then rechecking: ${CERT}"
  18. sleep 5s
  19. done
  20. if [[ ! -f "${CERT}" ]] ; then
  21. die "Cert file does not exist: ${CERT}"
  22. fi
  23. if [[ "${CERT}" == *.pem || "${CERT}" == *.p12 ]] ; then
  24. openssl x509 -in "${CERT}" -inform PEM -out "${CERT}.crt" || die "Error converting certificate"
  25. CERT="${CERT}.crt"
  26. fi
  27. mkdir -p /usr/local/share/ca-certificates || die "Error ensuring CA certs directory exists"
  28. cp "${CERT}" /usr/local/share/ca-certificates || die "Error installing certificate"
  29. update-ca-certificates || die "Error updating CA certificates"