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) |
Jonathan Hart | 520f227 | 2015-01-15 16:06:32 -0800 | [diff] [blame] | 13 | remHash=$(ssh $remote cksum $ONOS_TAR 2>/dev/null | cut -d' ' -f1,2) |
Thomas Vachuska | 52e6580 | 2014-12-08 09:26:01 -0800 | [diff] [blame] | 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 |