From 6a07d2d622eaa06953f3353e39c080984076e8de Mon Sep 17 00:00:00 2001 From: Ashlee Young Date: Fri, 9 Oct 2015 18:32:44 -0700 Subject: Updated master to commit id 6ee8aa3e67ce89908a8c93aa9445c6f71a18f986 Change-Id: I94b055ee2f298daf71e2ec794fd0f2495bd8081f --- framework/src/onos/tools/test/bin/onos-uninstall | 27 +++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) (limited to 'framework/src/onos/tools/test/bin/onos-uninstall') diff --git a/framework/src/onos/tools/test/bin/onos-uninstall b/framework/src/onos/tools/test/bin/onos-uninstall index 7a8b9a5f..ff8ff536 100755 --- a/framework/src/onos/tools/test/bin/onos-uninstall +++ b/framework/src/onos/tools/test/bin/onos-uninstall @@ -3,6 +3,24 @@ # Remotely stops & uninstalls ONOS on the specified node. # ----------------------------------------------------------------------------- +function _usage () { +cat << _EOF_ +usage: + $(basename $0) [node] + +options: +- [node] : The remote instance to uninstall ONOS from. + +summary: + Remotely stops and uninstalls ONOS on the specified node. + + If [node] isn't specified, \$OCI becomes the target. + +_EOF_ +} + +[ "$1" = "-h" ] && _usage && exit 0 + [ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1 . $ONOS_ROOT/tools/build/envDefaults @@ -16,9 +34,12 @@ ssh $remote " [ -z \"\$(ps -ef | grep karaf.jar | grep -v grep)\" ] && break sleep 1 done - [ -z \"\$(ps -ef | grep karaf.jar | grep -v grep)\" ] || echo 'ONOS failed to stop.' + [ -z \"\$(ps -ef | grep karaf.jar | grep -v grep)\" ] || \ + (echo 'ONOS failed to stop.'; status=1) # Remove onos directory and init file - sudo rm -fr $ONOS_INSTALL_DIR - [ -f /etc/init/onos.conf ] && sudo rm /etc/init/onos.conf + [ -d $ONOS_INSTALL_DIR ] && sudo rm -fr $ONOS_INSTALL_DIR + [ -f /etc/init/onos.conf ] && sudo rm -f /etc/init/onos.conf + + exit \${status:-0}; " -- cgit 1.2.3-korg