blob: f5caa1c26e42626386b60e55a57d7c24cb44cb8c [file] [log] [blame]
Jordan Halterman00e92da2018-05-22 23:05:52 -07001#!/bin/bash
2# -----------------------------------------------------------------------------
3# Remotely kills the Atomix service on the specified node.
4# -----------------------------------------------------------------------------
5
6[ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1
7. $ONOS_ROOT/tools/build/envDefaults
8
9ssh $ONOS_USER@${1:-$OCI} "
Jordan Halterman0b3ad5b2018-08-06 12:15:08 -070010 pid=\$(ps -ef | grep AtomixAgent | grep -v grep | cut -c10-15 | tr -d ' ')
Jordan Halterman00e92da2018-05-22 23:05:52 -070011 if [ -n \"\$pid\" ]; then
12 echo \"Killing Atomix process \$pid on \$(hostname)...\"
13 kill -9 \$pid
14 else
15 echo \"Atomix process is not running...\"
16 exit 1
17 fi
18"