blob: 8238fd37e9588fd7e878f79b37e99c9081f434cb [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} "
10 pid=\$(ps -ef | grep atomix-agent.jar | grep -v grep | cut -c10-15 | tr -d ' ')
11 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"