Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 20 additions & 21 deletions docker/cloudhsm-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,28 @@

if [[ -z "$HSM_IP" ]]; then
#statements
echo -e "\n* HSM_IP env variable must be set \n"
exit 1
fi

# Configure cloudhms-client
# COPY customerCA.crt /opt/cloudhsm/etc/
/opt/cloudhsm/bin/configure -a $HSM_IP
echo -e "\n* HSM_IP env variable not set: skipping CloudHSM connection \n"
else
# Configure cloudhms-client
# COPY customerCA.crt /opt/cloudhsm/etc/
/opt/cloudhsm/bin/configure -a $HSM_IP

# start cloudhsm client
echo -n "* Starting CloudHSM client ... "
/opt/cloudhsm/bin/cloudhsm_client /opt/cloudhsm/etc/cloudhsm_client.cfg &> /tmp/cloudhsm_client_start.log &
# start cloudhsm client
echo -n "* Starting CloudHSM client ... "
/opt/cloudhsm/bin/cloudhsm_client /opt/cloudhsm/etc/cloudhsm_client.cfg &> /tmp/cloudhsm_client_start.log &

# wait for startup
while true
do
if grep 'libevmulti_init: Ready !' /tmp/cloudhsm_client_start.log &> /dev/null
then
echo "[OK]"
break
fi
sleep 0.5
done
echo -e "\n* CloudHSM client started successfully ... \n"
# wait for startup
while true
do
if grep 'libevmulti_init: Ready !' /tmp/cloudhsm_client_start.log &> /dev/null
then
echo "[OK]"
break
fi
sleep 0.5
done
echo -e "\n* CloudHSM client started successfully ... \n"
fi

# start application
/opt/ethsigner/bin/ethsigner $@