Skip to content

Instantly share code, notes, and snippets.

@trebortech
Created June 22, 2022 19:23
Show Gist options
  • Save trebortech/246b4f45ce00433cc08ab04fe4deed75 to your computer and use it in GitHub Desktop.
Save trebortech/246b4f45ce00433cc08ab04fe4deed75 to your computer and use it in GitHub Desktop.
Multiple YubiHSM startup shell script
connector_path=/home/pi/yubihsm/yubihsm-connector
hsm1_serial=123456
hsm1_listen=172.16.16.10:1111
hsm2_serial=4234234
hsm2_listen=172.16.16.10:2222
#!/bin/bash
configfile='./hsm_list.config'
. $configfile
hsmcount=$(grep -c 'serial' $configfile)
for (( c=1; c<=$hsmcount; c++))
do
hsmserial="hsm${c}_serial"
hsmlisten="hsm${c}_listen"
$connector_path --listen ${!hsmlisten} --serial ${!hsmserial} &
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment