bisq/apitest/scripts/get-bisq-pid.sh
ghubstan 45c1a97938
Fix codacy problem in bash script
Double quote to prevent globbing and word splitting.
2020-07-14 12:21:13 -03:00

16 lines
412 B
Bash
Executable File

#!/bin/bash
# Find the pid of the java process by grepping for the mainClassName and appName,
# then print the 2nd column of the output to stdout.
#
# Doing this from Java is problematic, probably due to limitation of the
# apitest.linux.BashCommand implementation.
MAIN_CLASS_NAME=$1
APP_NAME=$2
# TODO args validation
ps aux | grep java | grep "${MAIN_CLASS_NAME}" | grep "${APP_NAME}" | awk '{print $2}'