blob: 6d5617d0de4adb7fefcf5b504160a37228bdc120 [file] [log] [blame]
Yuta HIGUCHI1dc2ae72017-02-13 16:49:59 -08001#!/bin/bash
2
3function _usage () {
4cat << _EOF_
5usage:
6 $(basename $0) (ONOS CLI commands)
7
8summary:
9 Issue ONOS CLI commands to all the nodes defined in the current cell.
10
11_EOF_
12}
13
14nodes=$(env | sort | egrep "^OC[0-9]+" | cut -d= -f2)
15
16if [ "$#" -eq 0 ]; then
17 echo "Expecting ONOS CLI commands"
18 _usage
19 exit 1
20fi
21
22[ "$1" = "-h" ] && _usage && exit 0
23[ "$1" = "--help" ] && _usage && exit 0
24
25for node in $nodes; do
26 echo "Issuing command on $node.."
27 ssh -p 8101 -o StrictHostKeyChecking=no $node "$@"
28done