Jordan Halterman | 00e92da | 2018-05-22 23:05:52 -0700 | [diff] [blame] | 1 | #!/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 | |
| 9 | ssh $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 | " |