-checkRun () {
- running=0
- while read a b c d e f g h
- do
- if [ "$h" == "/bin/sh /opt/opendaylight/bin/karaf server" ]
- then
- running=1
- fi
- done < <(ps -eaf)
- echo $running
-}
-
-while [ $( checkRun ) == 1 ]
-do
- echo "Karaf is still running, waiting..."
- sleep 5s
-done
+#The karaf command will exit when odl shuts down. This is the most reliable way to wait for opendaylight to stop
+#before exiting the docker container.
+${ODL_HOME}/bin/karaf