From 7cbad0346454e655984cfbbe9e786b21a69c15ff Mon Sep 17 00:00:00 2001 From: Esteban Mackay Q Date: Sat, 22 Jul 2023 10:06:41 -0500 Subject: [PATCH] Update update.sh --- update.sh | 101 ++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 79 insertions(+), 22 deletions(-) diff --git a/update.sh b/update.sh index a691c4b..3f8ee37 100644 --- a/update.sh +++ b/update.sh @@ -432,9 +432,46 @@ variable3=$(grep "COLOR_TEXT =" /opt/FDMR-Monitor/fdmr-mon.cfg) variable4=$(grep "COLOR_1 =" /opt/FDMR-Monitor/fdmr-mon.cfg) variable5=$(grep "COLOR_2 =" /opt/FDMR-Monitor/fdmr-mon.cfg) -sudo systemctl stop fdmr_mon.service -sudo systemctl stop proxy.service -sudo systemctl stop http.server-fdmr.service +if systemctl status http.server-fdmr2.service |grep "service; enabled;" >/dev/null 2>&1 +then sudo systemctl disable http.server-fdmr2.service + +fi +if ! systemctl status http.server-fdmr.service | grep "service; enabled;" >/dev/null 2>&1; then + sudo systemctl enable http.server-fdmr.service + +fi +if systemctl status fdmr_mon2.service |grep "service; enabled;" >/dev/null 2>&1 +then sudo systemctl disable fdmr_mon2.service + +fi +if ! systemctl status fdmr_mon.service | grep "service; enabled;" >/dev/null 2>&1; then + sudo systemctl enable fdmr_mon.service +fi +if ! systemctl status proxy.service | grep "service; enabled;" >/dev/null 2>&1; then + sudo systemctl enable proxy.service + +fi +##################################### +if systemctl status http.server-fdmr2.service |grep "active" >/dev/null 2>&1 +then systemctl stop http.server-fdmr2.service + +fi +if systemctl status http.server-fdmr.service |grep active >/dev/null 2>&1 +then sudo systemctl stop http.server-fdmr.service + +fi +if systemctl status fdmr_mon2.service |grep active >/dev/null 2>&1 +then sudo systemctl stop fdmr_mon2.service + +fi +if systemctl status fdmr_mon.service |grep active >/dev/null 2>&1 +then sudo systemctl stop fdmr_mon.service + +fi +if systemctl status proxy.service |grep "active" >/dev/null 2>&1 +then sudo systemctl stop proxy.service + +fi ############################################################## # service update @@ -855,40 +892,56 @@ sudo sed -i "s/All rights reserved.
.*/All rights reserved.
/dev/null 2>&1 +then + sh /opt/extra-2.sh + systemctl start fdmr_mon.service + systemctl start proxy.service + systemctl start http.server-fdmr.service +fi + EOFB1 ######################################### FDMR-Monitor2 Update ############################################################### sudo cat > /opt/monitor-update2.sh <<- "EOFB2" #!/bin/bash -if systemctl status http.server-fdmr.service |grep disable >/dev/null 2>&1 -then sudo systemctl enable http.server-fdmr.service +if systemctl status http.server-fdmr.service |grep "service; enabled;" >/dev/null 2>&1 +then sudo systemctl disable http.server-fdmr.service fi -if systemctl status http.server-fdmr2.service |grep active >/dev/null 2>&1 -then sudo systemctl stop http.server-fdmr2.service +if ! systemctl status fdmr_mon2.service | grep "service; enabled;" >/dev/null 2>&1; then + sudo systemctl enable fdmr_mon2.service fi -if systemctl status http.server-fdmr2.service |grep enable >/dev/null 2>&1 -then sudo systemctl disable http.server-fdmr2.service +if systemctl status fdmr_mon.service |grep "service; enabled;" >/dev/null 2>&1 +then sudo systemctl disable fdmr_mon.service fi -if systemctl status fdmr_mon.service |grep active >/dev/null 2>&1 -then sudo systemctl stop fdmr_mon.service +if ! systemctl status fdmr_mon2.service | grep "service; enabled;" >/dev/null 2>&1; then + sudo systemctl enable fdmr_mon2.service +fi +if ! systemctl status proxy.service | grep "service; enabled;" >/dev/null 2>&1; then + sudo systemctl enable proxy.service fi -if systemctl status fdmr_mon.service |grep disable >/dev/null 2>&1 -then sudo systemctl enable fdmr_mon.service +##################################### +if systemctl status http.server-fdmr.service |grep "active" >/dev/null 2>&1 +then systemctl stop http.server-fdmr.service + +fi +if systemctl status http.server-fdmr2.service |grep active >/dev/null 2>&1 +then sudo systemctl stop http.server-fdmr2.service + +fi +if systemctl status fdmr_mon.service |grep active >/dev/null 2>&1 +then sudo systemctl stop fdmr_mon.service fi if systemctl status fdmr_mon2.service |grep active >/dev/null 2>&1 then sudo systemctl stop fdmr_mon2.service fi -if systemctl status fdmr_mon2.service |grep enable >/dev/null 2>&1 -then sudo systemctl disable fdmr_mon2.service +if systemctl status proxy.service |grep "active" >/dev/null 2>&1 +then sudo systemctl stop proxy.service fi cd / @@ -968,9 +1021,13 @@ else sudo systemctl restart proxy.service fi -sh /opt/extra-3.sh -systemctl start fdmr_mon2.service -systemctl start http.server-fdmr2.service +if sudo systemctl status http.server-fdmr2.service |grep "service; enabled;" >/dev/null 2>&1 +then + sh /opt/extra-3.sh + systemctl start fdmr_mon2.service + systemctl start http.server-fdmr2.service +fi + EOFB2 ###################################################################################################################### # Cronedit