From 4187fb67fde5f465c103823be95cd5eee1db5f54 Mon Sep 17 00:00:00 2001 From: andlo Date: Thu, 9 Jan 2020 21:23:08 +0000 Subject: [PATCH] mistake in regex fixed --- start-mycroft.sh | 4 ++-- stop-mycroft.sh | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/start-mycroft.sh b/start-mycroft.sh index 7865100c5f..f3582d90e7 100755 --- a/start-mycroft.sh +++ b/start-mycroft.sh @@ -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} diff --git a/stop-mycroft.sh b/stop-mycroft.sh index a38201c634..51582cdfac 100755 --- a/stop-mycroft.sh +++ b/stop-mycroft.sh @@ -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."