Jonathan Hart
Committed by Gerrit Code Review

Use initctl commands rather than service to control the ONOS service.

This supports a wider variety of OSes other than just Ubuntu.

Change-Id: Ib8505aa504f568ffdc556b20fb1d07a082d90229
......@@ -31,14 +31,24 @@ if [ "${1}" = "-h" -o "${1}" = "--help" ]; then
exit 0
fi
# Select the target
if [ "${1}" = "--cell" ]; then
nodes=$(env | sort | egrep "OC[0-9]+" | cut -d= -f2)
else
nodes=${1:-$OCI}
fi
case $2 in
start|stop|restart|status)
# Select the target
if [ "${1}" = "--cell" ]; then
nodes=$(env | sort | egrep "OC[0-9]+" | cut -d= -f2)
else
nodes=${1:-$OCI}
fi
# Execute the remote commands
for node in $nodes; do
ssh $ONOS_USER@${node} "sudo service onos ${2:-status}"
done
# Execute the remote commands
for node in $nodes; do
ssh $ONOS_USER@${node} "sudo ${2:-status} onos"
done
;;
*)
echo "error: $2 is not a valid command"
echo ""
print_usage
;;
esac
......