Skip to content

Commit

Permalink
Update gridlabd-marimo
Browse files Browse the repository at this point in the history
  • Loading branch information
dchassin committed Jan 13, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 98d4fec commit c2f16e3
Showing 1 changed file with 20 additions and 8 deletions.
28 changes: 20 additions & 8 deletions subcommands/gridlabd-marimo
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit c2f16e3

Please sign in to comment.