Files
hpcore/test/vm-cluster/setup-node.sh
Ravin Perera 63f62228c2 hpfs binary update and vm cluster script improvements. (#305)
* Updated hpfs binary for log file extending fix.
* Updated vmcluster scripts to include separate hpfiles dir per contract.
2021-05-12 09:23:36 +05:30

28 lines
808 B
Bash
Executable File

#!/bin/bash
mode=$1
nodeid=$2
sshuser=$3
sshpass=$4
hostaddr=$5
basedir=$6
contdir=$7 # Contract directory
hpfiles=$8 # HP files dir
echo $nodeid. $hostaddr
if [ $mode = "new" ] || [ $mode = "updatebin" ]; then
echo "Uploading hp files to $basedir..."
sshpass -p $sshpass scp -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..."
sshpass -p $sshpass ssh $sshuser@$hostaddr $basedir/$hpfiles/setup-hp.sh $mode $basedir $contdir $hpfiles $hostaddr
fi
if [ $mode = "new" ] || [ $mode = "reconfig" ] || [ $mode = "updateconfig" ]; then
sshpass -p $sshpass scp $sshuser@$hostaddr:$contdir/cfg/hp.cfg ./cfg/node$nodeid.cfg
fi