blob: 5a8259ee02ad17571924dd13c62dcec49deff05e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
#!/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\|srtool_update.py\)" | 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
|