| # ----------------------------------------------------------------------------- |
| # Remotely stops & uninstalls ONOS on the specified node. |
| # ----------------------------------------------------------------------------- |
| - [node] : The remote instance to uninstall Atomix from. |
| Remotely stops and uninstalls Atomix on the specified node. |
| If [node] isn't specified, \$OCI becomes the target. |
| [ "$1" = "-h" ] && _usage && exit 0 |
| [ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1 |
| . $ONOS_ROOT/tools/build/envDefaults |
| remote=$ONOS_USER@${1:-$OCI} |
| pid=\$(ps -ef | grep AtomixAgent | grep -v grep | cut -c10-15 | tr -d ' ') |
| if [ -n \"\$pid\" ]; then |
| echo \"Killing Atomix process \$pid on \$(hostname)...\" |
| echo \"Atomix process is not running...\" |
| # Remove Atomix directory |
| [ -d $ATOMIX_INSTALL_DIR ] && sudo rm -fr $ATOMIX_INSTALL_DIR |