Updating onos-uninstall

- Wait for the onos process to die
- Remove /etc/init/onos.conf

Change-Id: I7e81adc6f94eca638fd46c0d503cfc1e843b4c0b
diff --git a/tools/test/bin/onos-uninstall b/tools/test/bin/onos-uninstall
index c04db7a..7a8b9a5 100755
--- a/tools/test/bin/onos-uninstall
+++ b/tools/test/bin/onos-uninstall
@@ -10,5 +10,15 @@
 
 ssh $remote "
     sudo stop onos 1>/dev/null 2>/dev/null
+
+    # Wait for onos to stop up to 5 seconds
+    for i in \$(seq 1 5); do
+      [ -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.'
+
+    # Remove onos directory and init file
     sudo rm -fr $ONOS_INSTALL_DIR
+    [ -f /etc/init/onos.conf ] && sudo rm /etc/init/onos.conf
 "