Thomas Vachuska | 52e6580 | 2014-12-08 09:26:01 -0800 | [diff] [blame^] | 1 | #!/bin/bash |
| 2 | # ----------------------------------------------------------------------------- |
| 3 | # Remotely pushes bits to a remote node 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 | |
| 9 | node=${1:-$OCI} |
| 10 | remote=$ONOS_USER@$node |
| 11 | |
| 12 | locHash=$(cksum $ONOS_TAR | cut -d' ' -f1,2) |
| 13 | remHash=$(ssh $remote cksum $ONOS_TAR | cut -d' ' -f1,2) |
| 14 | |
| 15 | if [ "$locHash" = "$remHash" ]; then |
| 16 | echo "ONOS bits $ONOS_TAR already up-to-date on $node..." |
| 17 | else |
| 18 | scp -q $ONOS_TAR $remote:/tmp |
| 19 | fi |