github.com/IBM-Blockchain/fabric-operator@v1.0.4/docker-entrypoint.sh (about) 1 #!/bin/sh 2 # 3 # Copyright contributors to the Hyperledger Fabric Operator project 4 # 5 # SPDX-License-Identifier: Apache-2.0 6 # 7 # Licensed under the Apache License, Version 2.0 (the "License"); 8 # you may not use this file except in compliance with the License. 9 # You may obtain a copy of the License at: 10 # 11 # http://www.apache.org/licenses/LICENSE-2.0 12 # 13 # Unless required by applicable law or agreed to in writing, software 14 # distributed under the License is distributed on an "AS IS" BASIS, 15 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 # See the License for the specific language governing permissions and 17 # limitations under the License. 18 # 19 20 if [ "${LICENSE}" = "accept" ]; then 21 : 22 elif [ "${LICENSE}" = "view" ]; then 23 cat /licenses/LA_en 24 exit 0 25 else 26 LANG_CODE=${LICENSE#view-*} 27 if [ "${LANG_CODE}" = "${LICENSE}" ]; then 28 echo "Please accept or view the License by setting the \"LICENSE\" env variable to \"accept\", \"view\" or \"view-<language-code>\"" 29 exit 1 30 else 31 cat /licenses/LI_${LANG_CODE} 32 exit 0 33 fi 34 fi 35 36 # Search for environment variables named SECRET_*, whose values specify a file 37 # name, and create a corresponding environment variable without the SECRET_ 38 # prefix whose value is the contents of the specified file. 39 for secret_entry in $(env | grep '^SECRET_'); do 40 name=${secret_entry%=*} && name=${name#SECRET_} 41 value=${secret_entry#*=} && value=$(cat $value) 42 export ${name}="${value}" 43 done 44 45 exec "$@"