aboutsummaryrefslogtreecommitdiffstats
path: root/bin/dev_tools/lssrt.sh
blob: f9404d0680f1610a8e6436378657f0d917b0e0a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/bash

# Show running SRT instances

declare -A srts
IFS=$'\n'       # make newlines the only separator
for p in $(ps -e -o pid,cmd | grep "manage.py runserver" | grep 'srt' ) ; do
    if [ "${p}" != "${p/grep/}" ] ; then
        continue
    fi
    d=${p#* }     # strip python path
    d=${d#* }     # strip python path
    p=${p# *}     # strip leading spaces
    pid=${p%% *}  # strip python path
    echo "[$pid]($d)"
done