From c2f16e32ed166c99e0ef1d01c88492a4c79e9564 Mon Sep 17 00:00:00 2001 From: "David P. Chassin" Date: Mon, 13 Jan 2025 06:34:31 -0800 Subject: [PATCH] Update gridlabd-marimo --- subcommands/gridlabd-marimo | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/subcommands/gridlabd-marimo b/subcommands/gridlabd-marimo index 662c731e5..9e29f5aef 100644 --- a/subcommands/gridlabd-marimo +++ b/subcommands/gridlabd-marimo @@ -111,7 +111,7 @@ function index() function getlist() { - basename -s .py $(ps -ax | grep bin/marimo | grep -v grep | sed -r 's/ +/ /g' | cut -f7 -d' ') 2>>$LOG + basename -s .py $(ps -ax | grep bin/marimo | grep -v grep | sed -r 's/ +/ /g' | rev | cut -f1 -d'/' | rev ) 2>>$LOG } function getpid() @@ -120,13 +120,6 @@ function getpid() ps ax | grep bin/marimo | grep $EXE | cut -f1 -d' ' 2>>$LOG } -function getinfo() -{ - for PID in $*; do - lsof -i -P -a -p $PID | tail -n +1 2>>$LOG - done -} - function geturl() { PID=$(getpid $1) @@ -228,6 +221,21 @@ function open() } +function status() +{ + LIST=$(getlist) + if [ ! -z "$LIST" ]; then + FORMAT="%-16.16s %-6.6s %-32.32s\n" + printf "$FORMAT" Name PID URL + printf "$FORMAT" ---------------- ------ -------------------------------- + for APP in $LIST; do + APPPID=$(getpid $APP) + APPURL=$(geturl $APP) + printf "$FORMAT" $APP $APPPID $APPURL + done + fi +} + mkdir -p $LIB/.etag echo "*** COMMAND = '$0 $*' ***" >>$LOG @@ -282,6 +290,10 @@ while [ $# -gt 0 ]; do index exit $E_OK ;; + status) + status + exit $E_OK + ;; list) # list of active apps getlist exit $E_OK