blob: d390e4477091bab205edac27ed9de65f832d24cb [file] [log] [blame]
tom890a43b2014-09-30 09:08:42 -07001#!/bin/bash
Pavlin Radoslavov91413792014-10-15 11:00:32 -07002# -----------------------------------------------------------------------------
tom890a43b2014-09-30 09:08:42 -07003# Remotely kills the ONOS service on the specified node.
Pavlin Radoslavov91413792014-10-15 11:00:32 -07004# -----------------------------------------------------------------------------
tom890a43b2014-09-30 09:08:42 -07005
6[ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1
7. $ONOS_ROOT/tools/build/envDefaults
8
Thomas Vachuskacbba0522014-12-03 19:03:31 -08009ssh $ONOS_USER@${1:-$OCI} "
Jordan Haltermana4c4ea82018-11-15 15:13:14 -080010 pid=\$(ps -ef | grep org.apache.karaf.main.Main | grep -v grep | cut -c10-15 | tr -d ' ')
Thomas Vachuskacbba0522014-12-03 19:03:31 -080011 if [ -n \"\$pid\" ]; then
12 echo \"Killing ONOS process \$pid on \$(hostname)...\"
13 kill -9 \$pid
14 else
15 echo \"ONOS process is not running...\"
16 exit 1
17 fi
18"