forked from hyperledger/fabric
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsofthsm.sh
25 lines (21 loc) · 948 Bytes
/
softhsm.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/bash -eu
#
# Copyright IBM Corp. All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0
export DEBIAN_FRONTEND=noninteractive
# ----------------------------------------------------------------
# Install SoftHSM
# ----------------------------------------------------------------
apt-get install -y softhsm2
# ----------------------------------------------------------------
# Create tokens directory
# ----------------------------------------------------------------
mkdir -p /home/vagrant/.tokens
chown -R vagrant.vagrant /home/vagrant/.tokens
# ----------------------------------------------------------------
# Setup softhsm configuration file
# ----------------------------------------------------------------
mkdir -p /home/vagrant/.config/softhsm2
sed s,/var/lib/softhsm/tokens/,/home/vagrant/.tokens,g < /etc/softhsm/softhsm2.conf > /home/vagrant/.config/softhsm2/softhsm2.conf
chown -R vagrant.vagrant /home/vagrant/.config