4
0
Carl Tashian 3 жил өмнө
parent
commit
640bd0b7c7
1 өөрчлөгдсөн 15 нэмэгдсэн , 15 устгасан
  1. 15 15
      docker/entrypoint.sh

+ 15 - 15
docker/entrypoint.sh

@@ -19,7 +19,7 @@ function init_if_possible () {
         fi
         fi
     done
     done
     if [ ${missing_vars} = 1 ]; then
     if [ ${missing_vars} = 1 ]; then
-		>&2 echo "there is no ca.json config file; please run step ca init, or provide config parameters via DOCKER_STEPCA_INIT_ vars"
+        >&2 echo "there is no ca.json config file; please run step ca init, or provide config parameters via DOCKER_STEPCA_INIT_ vars"
     else
     else
         step_ca_init "${@}"
         step_ca_init "${@}"
     fi
     fi
@@ -36,18 +36,18 @@ function generate_password () {
 function step_ca_init () {
 function step_ca_init () {
     local -a setup_args=(
     local -a setup_args=(
         --name "${DOCKER_STEPCA_INIT_NAME}"
         --name "${DOCKER_STEPCA_INIT_NAME}"
-		--dns "${DOCKER_STEPCA_INIT_DNS_NAMES}"
-		--provisioner "${DOCKER_STEPCA_INIT_PROVISIONER_NAME:-admin}"
-		--password-file "${STEPPATH}/password"
-		--provisioner-password-file "${STEPPATH}/provisioner_password"
+        --dns "${DOCKER_STEPCA_INIT_DNS_NAMES}"
+        --provisioner "${DOCKER_STEPCA_INIT_PROVISIONER_NAME:-admin}"
+        --password-file "${STEPPATH}/password"
+        --provisioner-password-file "${STEPPATH}/provisioner_password"
         --address ":9000"
         --address ":9000"
     )
     )
     if [ -n "${DOCKER_STEPCA_INIT_PASSWORD}" ]; then
     if [ -n "${DOCKER_STEPCA_INIT_PASSWORD}" ]; then
         echo "${DOCKER_STEPCA_INIT_PASSWORD}" > "${STEPPATH}/password"
         echo "${DOCKER_STEPCA_INIT_PASSWORD}" > "${STEPPATH}/password"
         echo "${DOCKER_STEPCA_INIT_PASSWORD}" > "${STEPPATH}/provisioner_password"
         echo "${DOCKER_STEPCA_INIT_PASSWORD}" > "${STEPPATH}/provisioner_password"
-	else
-		generate_password > "${STEPPATH}/password"
-		generate_password > "${STEPPATH}/provisioner_password"
+    else
+        generate_password > "${STEPPATH}/password"
+        generate_password > "${STEPPATH}/provisioner_password"
     fi
     fi
     if [ -n "${DOCKER_STEPCA_INIT_SSH}" ]; then
     if [ -n "${DOCKER_STEPCA_INIT_SSH}" ]; then
         setup_args=("${setup_args[@]}" --ssh)
         setup_args=("${setup_args[@]}" --ssh)
@@ -60,22 +60,22 @@ function step_ca_init () {
     fi
     fi
     step ca init "${setup_args[@]}"
     step ca init "${setup_args[@]}"
     mv $STEPPATH/password $PWDPATH
     mv $STEPPATH/password $PWDPATH
-	mv $STEPPATH/provisioner_password $PROVISIONER_PWDPATH
+    mv $STEPPATH/provisioner_password $PROVISIONER_PWDPATH
 }
 }
 
 
 if [ -f /usr/sbin/pcscd ]; then
 if [ -f /usr/sbin/pcscd ]; then
-	/usr/sbin/pcscd
+    /usr/sbin/pcscd
 fi
 fi
 
 
 if [ ! -f "${STEPPATH}/config/ca.json" ]; then
 if [ ! -f "${STEPPATH}/config/ca.json" ]; then
-	init_if_possible
+    init_if_possible
 fi
 fi
 
 
 if [ ! -f "${PROVISIONER_PWDPATH}" ]; then
 if [ ! -f "${PROVISIONER_PWDPATH}" ]; then
-	# For backward compatibility,
-	# if the --provisioner-password-file doesn't exist,
-	# use the same password as the CA.
-	cp ${PWDPATH} ${PROVISIONER_PWDPATH}
+    # For backward compatibility,
+    # if the --provisioner-password-file doesn't exist,
+    # use the same password as the CA.
+    cp ${PWDPATH} ${PROVISIONER_PWDPATH}
 fi
 fi
 
 
 exec "${@}"
 exec "${@}"