#!/bin/sh set -e # TODO fix the env so configures it to idp, then uncomment this checker #set -u # DEBUG set -x # this function is similar to the client_id part of config_oidc (devicehub) oidc_config() { # in DEVICEHUB_HOST we remove anything before :// client_id_config="/shared/client_id_${SERVER_ID_HOST#*://}" CLIENT_ID= CLIENT_SECRET= # wait that the file generated by the server_id is readable while true; do if [ -f "${client_id_config}" ]; then CLIENT_ID="$(cat "${client_id_config}" | jq -r '.client_id')" CLIENT_SECRET="$(cat "${client_id_config}" | jq -r '.client_secret')" if [ "${CLIENT_ID}" ] && [ "${CLIENT_SECRET}" ]; then break fi fi sleep 1 done } populate_env() { cat > .env <