mistake in regex fixed

pull/2449/head
andlo 2020-01-09 21:23:08 +00:00
parent 0231b75928
commit 4187fb67fd
2 changed files with 5 additions and 5 deletions

View File

@ -106,7 +106,7 @@ function launch-process() {
function require-process() {
# Launch process if not found
name-to-script-path ${1}
if ! pgrep -f "python3 (.*) -m ${_module}" > /dev/null ; then
if ! pgrep -f "python3 (.*)-m ${_module}" > /dev/null ; then
# Start required process
launch-background ${1}
fi
@ -117,7 +117,7 @@ function launch-background() {
# Check if given module is running and start (or restart if running)
name-to-script-path ${1}
if pgrep -f "python3 (.*) -m ${_module}" > /dev/null ; then
if pgrep -f "python3 (.*)-m ${_module}" > /dev/null ; then
if ($_force_restart) ; then
echo "Restarting: ${1}"
"${DIR}/stop-mycroft.sh" ${1}

View File

@ -41,7 +41,7 @@ function help() {
}
function process-running() {
if [[ $( pgrep -f "python3 (.*) -m mycroft.*${1}" ) ]] ; then
if [[ $( pgrep -f "python3 (.*)-m mycroft.*${1}" ) ]] ; then
return 0
else
return 1
@ -51,7 +51,7 @@ function process-running() {
function end-process() {
if process-running $1 ; then
# Find the process by name, only returning the oldest if it has children
pid=$( pgrep -o -f "python3 (.*) -m mycroft.*${1}" )
pid=$( pgrep -o -f "python3 (.*)-m mycroft.*${1}" )
echo -n "Stopping $1 (${pid})..."
kill -SIGINT ${pid}
@ -68,7 +68,7 @@ function end-process() {
if process-running $1 ; then
echo "failed to stop."
pid=$( pgrep -o -f "python3 (.*) -m mycroft.*${1}" )
pid=$( pgrep -o -f "python3 (.*)-m mycroft.*${1}" )
echo -n " Killing $1 (${pid})..."
kill -9 ${pid}
echo "killed."