Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F92898128
step4.sh
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sun, Nov 24, 15:09
Size
1 KB
Mime Type
text/x-shellscript
Expires
Tue, Nov 26, 15:09 (2 d)
Engine
blob
Format
Raw Data
Handle
22529134
Attached To
R4444 MedCo Deployment
step4.sh
View Options
#!/bin/bash
##################################################################
# MedCo configuration generator: step 4
# generate unlynx keys & package files to share
##################################################################
set -e
shopt -s nullglob
if [ $# != 3 ]
then
echo "Usage:"
echo "Generate certificate with the generated CA:"
echo " bash step4.sh CONFIGURATION_PROFILE NODE_INDEX NODE_IP"
exit
fi
SCRIPT_FOLDER="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"/..
CONF_PROFILE="$1"
CONF_FOLDER="$SCRIPT_FOLDER/../../configuration-profiles/$CONF_PROFILE"
COMPOSE_FOLDER="$SCRIPT_FOLDER/../../compose-profiles/$CONF_PROFILE"
NODE_IDX="$2"
NODE_IP="$3"
# check dependency
which docker
##################################################################
# execute step 4
##################################################################
echo "### Producing Unlynx binary with Docker"
docker build -t lca1/unlynx:medco-deployment "$SCRIPT_FOLDER"/../../docker-images/unlynx/
docker run -v "$CONF_FOLDER":/opt/medco-configuration --entrypoint sh lca1/unlynx:medco-deployment /copy-unlynx-binary.sh
echo "### Generating unlynx keys"
"$CONF_FOLDER"/unlynxMedCo server setupNonInteractive --serverBinding "$NODE_IP:2000" --description "Unlynx Server $NODE_IDX" \
--privateTomlPath "$CONF_FOLDER/srv$NODE_IDX-private.toml" --publicTomlPath "$CONF_FOLDER/srv$NODE_IDX-public.toml"
echo "### Packaging files to share"
tar -cvzf "$CONF_FOLDER/srv$NODE_IDX-publicdata.tar.gz" \
-C "$CONF_FOLDER" \
"srv$NODE_IDX-public.toml" \
"srv$NODE_IDX-shrine_downstream_nodes.conf" \
"srv$NODE_IDX-CA/cacert.pem"
echo "### Done! Share the archive srv$NODE_IDX-publicdata.tar.gz with the responsible of the other nodes"
Event Timeline
Log In to Comment