Enhanced onos-setup-karaf to be more robust and more friendly. It will validate the specified IP, if given. Otherwise, it will attempt to use ONOS_IP and if that's not available ONOS_NIC to find an adapter with a matching IP address. Usage is backwards compatible.

Also added new onos-karaf command which runs onos-setup-karaf && karaf $@ as a convenience; aliased to 'ok'.

Corrected onos-build-selective to propagate error status only if the build fails.

Change-Id: I920b06fa21edc95b7d651270efe2f95da90ff010
diff --git a/tools/dev/bash_profile b/tools/dev/bash_profile
index cd6778f..7279ebe 100644
--- a/tools/dev/bash_profile
+++ b/tools/dev/bash_profile
@@ -45,6 +45,7 @@
 alias obs='onos-build-selective'
 alias obd='onos-build-docs'
 alias op='onos-package'
+alias ok='onos-karaf'
 alias ot='onos-test'
 alias ol='onos-log'
 alias ow='onos-watch'
diff --git a/tools/dev/bin/onos-build-selective b/tools/dev/bin/onos-build-selective
index 576db7a..35ad72e 100755
--- a/tools/dev/bin/onos-build-selective
+++ b/tools/dev/bin/onos-build-selective
@@ -33,6 +33,10 @@
 
     echo Building projects $projects
     cd $ONOS_ROOT && mvn --projects $projects ${@:-clean install}
+    status=$?
 
     [ -n "$appProjects" ] && echo "App staging required for projects $appProjects"
+    exit $status
+else
+    exit 0
 fi