ervu-sign-module/entrypoint.sh

25 lines
819 B
Bash
Raw Permalink Normal View History

2024-09-11 17:30:53 +03:00
#!/bin/bash
2025-02-06 13:18:01 +03:00
set -e
echo "Starting cryptsrv"
/opt/cprocsp/sbin/amd64/cryptsrv
echo $?
set +e
2024-12-25 23:17:38 +03:00
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
2024-09-11 17:30:53 +03:00
fi
su - -c '/opt/cprocsp/bin/amd64/csptest -absorb -certs -autoprov' $RUNTIME_USER
2024-11-21 15:07:28 +03:00
2024-12-25 23:17:38 +03:00
echo "Installing CA certificates"
su - -c 'find ~/cacerts -regex ".*\.\(cer\|crt\)$" -exec /opt/cprocsp/bin/amd64/certmgr -install -store uCA -file {} \;' $RUNTIME_USER
2024-12-25 23:17:38 +03:00
2025-02-06 13:18:01 +03:00
echo "Installing certificates"
su - -c 'find ~/certs -regex ".*\.\(cer\|crt\)$" -exec /opt/cprocsp/bin/amd64/certmgr -install -file {} \;' $RUNTIME_USER
2024-11-21 16:13:48 +03:00
su - -c '/opt/ervu-sign-module/ervu-sign-module' $RUNTIME_USER