fix: running process check, match only node processes

This commit is contained in:
Roni Väyrynen
2024-09-03 14:54:43 +03:00
parent 4f066ccad6
commit 083219d008

View File

@@ -706,7 +706,7 @@ function InstallXO {
InstallXOPlugins
# shutdown possibly running xo-server
if [[ $(runcmd_stdout "pgrep -f 'node.*xo-server'") ]]; then
if [[ $(runcmd_stdout "pgrep -f '^([a-zA-Z0-9_\/-]+?)node.*xo-server'") ]]; then
echo
printprog "Shutting down running xo-server"
runcmd "/bin/systemctl stop xo-server" || {
@@ -991,7 +991,7 @@ function InstallXOProxy {
printok "Running installation"
# shutdown possibly running xo-server
if [[ $(runcmd_stdout "pgrep -f 'node.*xo-proxy'") ]]; then
if [[ $(runcmd_stdout "pgrep -f '^([a-zA-Z0-9_\/-]+?)node.*xo-proxy'") ]]; then
echo
printprog "Shutting down running xo-proxy"
runcmd "/bin/systemctl stop xo-proxy" || {
@@ -1468,7 +1468,7 @@ function StartUpScreen {
case $option in
1)
if [[ $(runcmd_stdout "pgrep -f 'node.*xo-server'") ]]; then
if [[ $(runcmd_stdout "pgrep -f '^([a-zA-Z0-9_\/-]+?)node.*xo-server'") ]]; then
echo "Looks like xo-server process is already running, consider running update instead. Continue anyway?"
read -r -p "[y/N]: " answer
case $answer in
@@ -1515,7 +1515,7 @@ function StartUpScreen {
exit 0
;;
4)
if [[ $(runcmd_stdout "pgrep -f 'node.*xo-proxy'") ]]; then
if [[ $(runcmd_stdout "pgrep -f '^([a-zA-Z0-9_\/-]+?)node.*xo-proxy'") ]]; then
echo "Looks like xo-proxy process is already running, consider running update instead. Continue anyway?"
read -r -p "[y/N]: " answer
case $answer in