added listing of subhosts
[rrq/overlay-boot.git] / functions
index feb500e4839a8fa8990450d7cd836b4d28e9379e..968c99db93603adddc6135312d61652dc187eea0 100644 (file)
--- a/functions
+++ b/functions
@@ -122,3 +122,11 @@ is_live() {
     [ -z "$USPID" ] && return 1
     echo $USPID $(pgrep -f ".reaper $NAME")
 }
+
+list_running() {
+    for C in $(pgrep -a overlay-boot | awk '{print $4}') ; do
+       eval NAME="$(sed "/^NAME=.*/{s|^NAME=||;b};d" $C)"
+       [ -z "$NAME" ] && NAME=$(basename $C .conf)
+       echo $NAME
+    done
+}