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} " |
Jordan Halterman | 0b3ad5b | 2018-08-06 12:15:08 -0700 | [diff] [blame] | 10 | pid=\$(ps -ef | grep AtomixAgent | grep -v grep | cut -c10-15 | tr -d ' ') |
Jordan Halterman | 00e92da | 2018-05-22 23:05:52 -0700 | [diff] [blame] | 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 | " |