blob: e7d80317755959d727029386bb5a9cdb7be224cc [file] [log] [blame]
Yuta HIGUCHIc1e5f802017-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.."
You Wangdafd5b72017-09-08 14:23:15 -070027 ssh -q -p 8101 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null $node "$@"
Yuta HIGUCHIc1e5f802017-02-13 16:49:59 -080028done