Update update.sh

merge-requests/1/head
Esteban Mackay Q 2 years ago
parent 02e4af938a
commit 7cbad03464

@ -432,9 +432,46 @@ variable3=$(grep "COLOR_TEXT =" /opt/FDMR-Monitor/fdmr-mon.cfg)
variable4=$(grep "COLOR_1 =" /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) variable5=$(grep "COLOR_2 =" /opt/FDMR-Monitor/fdmr-mon.cfg)
sudo systemctl stop fdmr_mon.service if systemctl status http.server-fdmr2.service |grep "service; enabled;" >/dev/null 2>&1
sudo systemctl stop proxy.service then sudo systemctl disable http.server-fdmr2.service
sudo systemctl stop http.server-fdmr.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 # service update
@ -855,40 +892,56 @@ sudo sed -i "s/All rights reserved.<br>.*/All rights reserved.<br><a title=\"Ras
chmod +x /opt/FDMR-Monitor/sysinfo/* chmod +x /opt/FDMR-Monitor/sysinfo/*
sh /opt/FDMR-Monitor/sysinfo/rrd-db.sh sh /opt/FDMR-Monitor/sysinfo/rrd-db.sh
sh /opt/extra-2.sh if sudo systemctl status http.server-fdmr.service |grep "service; enabled;" >/dev/null 2>&1
systemctl start fdmr_mon.service then
systemctl start proxy.service sh /opt/extra-2.sh
systemctl start http.server-fdmr.service systemctl start fdmr_mon.service
systemctl start proxy.service
systemctl start http.server-fdmr.service
fi
EOFB1 EOFB1
######################################### FDMR-Monitor2 Update ############################################################### ######################################### FDMR-Monitor2 Update ###############################################################
sudo cat > /opt/monitor-update2.sh <<- "EOFB2" sudo cat > /opt/monitor-update2.sh <<- "EOFB2"
#!/bin/bash #!/bin/bash
if systemctl status http.server-fdmr.service |grep disable >/dev/null 2>&1 if systemctl status http.server-fdmr.service |grep "service; enabled;" >/dev/null 2>&1
then sudo systemctl enable http.server-fdmr.service then sudo systemctl disable http.server-fdmr.service
fi fi
if systemctl status http.server-fdmr2.service |grep active >/dev/null 2>&1 if ! systemctl status fdmr_mon2.service | grep "service; enabled;" >/dev/null 2>&1; then
then sudo systemctl stop http.server-fdmr2.service sudo systemctl enable fdmr_mon2.service
fi fi
if systemctl status http.server-fdmr2.service |grep enable >/dev/null 2>&1 if systemctl status fdmr_mon.service |grep "service; enabled;" >/dev/null 2>&1
then sudo systemctl disable http.server-fdmr2.service then sudo systemctl disable fdmr_mon.service
fi fi
if systemctl status fdmr_mon.service |grep active >/dev/null 2>&1 if ! systemctl status fdmr_mon2.service | grep "service; enabled;" >/dev/null 2>&1; then
then sudo systemctl stop fdmr_mon.service 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 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 fi
if systemctl status fdmr_mon2.service |grep active >/dev/null 2>&1 if systemctl status fdmr_mon2.service |grep active >/dev/null 2>&1
then sudo systemctl stop fdmr_mon2.service then sudo systemctl stop fdmr_mon2.service
fi fi
if systemctl status fdmr_mon2.service |grep enable >/dev/null 2>&1 if systemctl status proxy.service |grep "active" >/dev/null 2>&1
then sudo systemctl disable fdmr_mon2.service then sudo systemctl stop proxy.service
fi fi
cd / cd /
@ -968,9 +1021,13 @@ else
sudo systemctl restart proxy.service sudo systemctl restart proxy.service
fi fi
sh /opt/extra-3.sh if sudo systemctl status http.server-fdmr2.service |grep "service; enabled;" >/dev/null 2>&1
systemctl start fdmr_mon2.service then
systemctl start http.server-fdmr2.service sh /opt/extra-3.sh
systemctl start fdmr_mon2.service
systemctl start http.server-fdmr2.service
fi
EOFB2 EOFB2
###################################################################################################################### ######################################################################################################################
# Cronedit # Cronedit

Loading…
Cancel
Save

Powered by TurnKey Linux.