Merge pull request #254 from ronivay/fix/running-process-check

fix: running process check, match only node processes
This commit is contained in:
Roni Väyrynen
2024-09-03 15:16:56 +03:00
committed by GitHub

View File

@@ -706,7 +706,7 @@ function InstallXO {
InstallXOPlugins InstallXOPlugins
# shutdown possibly running xo-server # 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 echo
printprog "Shutting down running xo-server" printprog "Shutting down running xo-server"
runcmd "/bin/systemctl stop xo-server" || { runcmd "/bin/systemctl stop xo-server" || {
@@ -991,7 +991,7 @@ function InstallXOProxy {
printok "Running installation" printok "Running installation"
# shutdown possibly running xo-server # 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 echo
printprog "Shutting down running xo-proxy" printprog "Shutting down running xo-proxy"
runcmd "/bin/systemctl stop xo-proxy" || { runcmd "/bin/systemctl stop xo-proxy" || {
@@ -1468,7 +1468,7 @@ function StartUpScreen {
case $option in case $option in
1) 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?" echo "Looks like xo-server process is already running, consider running update instead. Continue anyway?"
read -r -p "[y/N]: " answer read -r -p "[y/N]: " answer
case $answer in case $answer in
@@ -1515,7 +1515,7 @@ function StartUpScreen {
exit 0 exit 0
;; ;;
4) 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?" echo "Looks like xo-proxy process is already running, consider running update instead. Continue anyway?"
read -r -p "[y/N]: " answer read -r -p "[y/N]: " answer
case $answer in case $answer in