ervu-sign-module/entrypoint.sh
2024-12-25 23:17:38 +03:00

19 lines
621 B
Bash

#!/bin/bash
username=$(whoami)
if [ ! -d /var/opt/cprocsp/keys/$username ]; then
mkdir -m 700 /var/opt/cprocsp/keys/$username
cp -r ~/keys/* /var/opt/cprocsp/keys/$username/
chown -R $username:$username /var/opt/cprocsp/keys/$username
fi
/opt/cprocsp/bin/amd64/csptest -absorb -certs -autoprov
echo "Installing CA certificates"
find ~/cacerts -regex ".*\.\(cer\|crt\)$" -exec /opt/cprocsp/bin/amd64/certmgr -install -store uCA -file {} \;
echo "Installing certificates" \
find ~/certs -regex ".*\.\(cer\|crt\)$" -exec /opt/cprocsp/bin/amd64/certmgr -install -file {} \;
/opt/ervu-sign-module/ervu-sign-module