From: Ralph Ronnquist Date: Fri, 25 Mar 2022 09:57:49 +0000 (+1100) Subject: added listing of subhosts X-Git-Tag: deb_0.1~17 X-Git-Url: https://git.rrq.au/?a=commitdiff_plain;h=0a18b8716dacd4a0c0e7fa231b75b08806e69db1;p=rrq%2Foverlay-boot.git added listing of subhosts --- diff --git a/functions b/functions index feb500e..968c99d 100644 --- 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 +} diff --git a/overlay-go b/overlay-go index d22ef35..b055d98 100755 --- a/overlay-go +++ b/overlay-go @@ -5,6 +5,11 @@ NAME="$1" +if [ -z "$NAME" ] ; then + echo "Select subhost: $(list_running)" + exit 0 +fi + read USPID RSPID <