The main Bubble source repository. Contains the Bubble API server, the web UI, documentation and utilities. https://getbubblenow.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

24 lines
810 B

  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. MITM_DIR=${1:?no mitm dir specified}
  6. CERT_NAME=${2:?no cert name specified}
  7. if [[ ! -d "${MITM_DIR}" ]] ; then
  8. echo "mitm dir does not exist or is not a directory: ${MITM_DIR}"
  9. exit 1
  10. fi
  11. OPTIONS_FILE="${MITM_DIR}/mitmproxy/options.py"
  12. if [[ ! -f "${OPTIONS_FILE}" ]] ; then
  13. echo "options.py not found in mitm dir: ${MITM_DIR}"
  14. exit 1
  15. fi
  16. if [[ $(cat "${OPTIONS_FILE}" | egrep '^CONF_BASENAME =' | grep "${CERT_NAME}" | wc -l | tr -d ' ') -eq 0 ]] ; then
  17. temp="$(mktemp /tmp/options.py.XXXXXXX)"
  18. cat "${OPTIONS_FILE}" | sed -e 's/^CONF_BASENAME\s*=.*/CONF_BASENAME = "'"${CERT_NAME}"'"/' > "${temp}"
  19. mv "${temp}" "${OPTIONS_FILE}"
  20. fi