Files
hpcore/test/vm-cluster/setup-node.sh
Ravin Perera 07962bc3d5 Improvements for larger clsuters. (#316)
- Cluster script improvements.
- Skipped msg too old check unverified peer sessions.
- Moved known peer maintenance to peer loop.
2021-05-30 12:32:51 +05:30

27 lines
827 B
Bash
Executable File

#!/bin/bash
mode=$1
nodeid=$2
sshuser=$3
hostaddr=$4
basedir=$5
contdir=$6 # Contract directory
hpfiles=$7 # HP files dir
echo $nodeid. $hostaddr
if [ $mode = "new" ] || [ $mode = "updatebin" ]; then
echo "Uploading hp files to $basedir..."
scp -q -o StrictHostKeyChecking=no -rp hpfiles $sshuser@$hostaddr:$basedir/
echo "Upload finished."
fi
# Run hp setup script on the node and download the generated hp.cfg
if [ $mode = "new" ] || [ $mode = "reconfig" ]; then
echo "Configuring HP..."
ssh -o StrictHostKeyChecking=no $sshuser@$hostaddr $basedir/$hpfiles/setup-hp.sh $mode $basedir $contdir $hpfiles $hostaddr
fi
if [ $mode = "new" ] || [ $mode = "reconfig" ] || [ $mode = "updateconfig" ]; then
scp -q -o StrictHostKeyChecking=no $sshuser@$hostaddr:$contdir/cfg/hp.cfg ./cfg/node$nodeid.cfg
fi