ervu-sign-module/entrypoint.sh
Наиля Алашкова e351409288 Merge branch 'release/1.2.4' into master
# Conflicts:
#	CMakeLists.txt
#	Dockerfile.micord
#	entrypoint.sh
#	src/modules/service_sign.c
2025-02-19 09:06:44 +03:00

24 lines
819 B
Bash

#!/bin/bash
set -e
echo "Starting cryptsrv"
/opt/cprocsp/sbin/amd64/cryptsrv
echo $?
set +e
if [ ! -d /var/opt/cprocsp/keys/$RUNTIME_USER ]; then
mkdir -m 700 /var/opt/cprocsp/keys/$RUNTIME_USER
cp -r /home/$RUNTIME_USER/keys/* /var/opt/cprocsp/keys/$RUNTIME_USER/
chown -R $RUNTIME_USER:$RUNTIME_USER /var/opt/cprocsp/keys/$RUNTIME_USER
fi
su - -c '/opt/cprocsp/bin/amd64/csptest -absorb -certs -autoprov' $RUNTIME_USER
echo "Installing CA certificates"
su - -c 'find ~/cacerts -regex ".*\.\(cer\|crt\)$" -exec /opt/cprocsp/bin/amd64/certmgr -install -store uCA -file {} \;' $RUNTIME_USER
echo "Installing certificates"
su - -c 'find ~/certs -regex ".*\.\(cer\|crt\)$" -exec /opt/cprocsp/bin/amd64/certmgr -install -file {} \;' $RUNTIME_USER
su - -c '/opt/ervu-sign-module/ervu-sign-module' $RUNTIME_USER