blob: 24e2174cc7d57f9192e1e4636a0859d300cc588c [file] [log] [blame]
Jordan Halterman6b384252018-10-26 19:13:25 -07001#!/bin/bash
2# -----------------------------------------------------------------------------
3# Remotely pushes Atomix bits to all remote nodes in preparation for install.
4# -----------------------------------------------------------------------------
5
6[ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1
7. $ONOS_ROOT/tools/build/envDefaults
8
9OCT=${OCT:-$OCI}
10node=${1:-$OCT}
11remote=$ONOS_USER@$node
12shift
13
14echo "Pushing to proxy $node..."
15atomix-push-bits $node
16
17others=$(env | sort | egrep "^OCC[0-9]+" | cut -d= -f2 | grep -vE "^$OCT\$")
18
19ssh $remote "
20 for other in ${others//$'\n'/ } ; do
21 echo \"Pushing to \$other ...\";
22 ssh -o StrictHostKeyChecking=no $ONOS_USER@\$other rm -rf /tmp/atomix.tar.gz &&
23 scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \
24 /tmp/atomix.tar.gz \
25 $ONOS_USER@[\$other]:/tmp/atomix.tar.gz
26 done
27"