Update update.sh

merge-requests/1/head
Esteban Mackay Q 2 years ago
parent 3794b664d6
commit 6fc8fa84a0

@ -450,12 +450,9 @@ 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)
cronedit.sh '*/5 * * * *' 'sh /opt/FDMR-Monitor/sysinfo/graph.sh' remove
cronedit.sh '*/2 * * * *' 'sh /opt/FDMR-Monitor/sysinfo/cpu.sh' remove
cronedit.sh '* */24 * * *' 'rm /opt/FDMR-Monitor/data/*' remove
cronedit.sh '* */24 * * *' 'rm /opt/FDMR-Monitor2/data/*' remove
#####################################
if systemctl status http.server-fdmr2.service |grep active >/dev/null 2>&1
if systemctl status http.server-fdmr2.service |grep "active" >/dev/null 2>&1
then systemctl stop http.server-fdmr2.service
fi
@ -471,7 +468,7 @@ 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
if systemctl status proxy.service |grep "active" >/dev/null 2>&1
then sudo systemctl stop proxy.service
fi
@ -903,6 +900,15 @@ sh /opt/FDMR-Monitor/sysinfo/rrd-db.sh
systemctl daemon-reload
##############
if systemctl status mariadb.service |grep inactive >/dev/null 2>&1
then sudo systemctl start mariadb.service
fi
if systemctl status mariadb.service |grep disable >/dev/null 2>&1
then sudo systemctl enable mariadb.service
fi
if systemctl status http.server-fdmr2.service |grep "service; enabled;" >/dev/null 2>&1
then sudo systemctl disable http.server-fdmr2.service
@ -922,9 +928,9 @@ if ! systemctl status proxy.service | grep "service; enabled;" >/dev/null 2>&1;
sudo systemctl enable proxy.service
fi
##############
if sudo systemctl status http.server-fdmr.service |grep "service; enabled;" >/dev/null 2>&1
then
variable1=$(grep "Web-Dashboar-Port:" /opt/wdp | grep -Eo '[A.0-9]{1,9}') &&
if [ -z "$variable1" ]
then variable1=80
@ -933,11 +939,12 @@ then
sudo sed -i "s/ExecStart=.*/ExecStart=php -S 0.0.0.0:$variable1 -t \/var\/www\/fdmr\//g" /lib/systemd/system/http.server-fdmr.service &&
sudo sed -i "s/ExecStart=.*/ExecStart=php -S 0.0.0.0:$variable1 -t \/var\/www\/fdmr2\//g" /lib/systemd/system/http.server-fdmr2.service &&
systemctl daemon-reload &&
systemctl restart fdmr_mon.service
systemctl restart proxy.service
systemctl restart http.server-fdmr.service
systemctl start fdmr_mon.service
systemctl start proxy.service
systemctl start http.server-fdmr.service
sh /opt/extra-2.sh
fi
(crontab -l; echo "* */1 * * * sync ; echo 3 > /proc/sys/vm/drop_caches >/dev/null 2>&1")|awk '!x[$0]++'|crontab -
cronedit.sh '*/5 * * * *' 'sh /opt/FDMR-Monitor/sysinfo/graph.sh' add &&
cronedit.sh '*/2 * * * *' 'sh /opt/FDMR-Monitor/sysinfo/cpu.sh' add &&
cronedit.sh '*/5 * * * *' 'sh /etc/freedmr/hbmon/sysinfo/graph.sh' remove &&
@ -950,7 +957,7 @@ EOFB1
######################################### FDMR-Monitor2 Update ###############################################################
sudo cat > /opt/monitor-update2.sh <<- "EOFB2"
#!/bin/bash
if systemctl status http.server-fdmr.service |grep active >/dev/null 2>&1
if systemctl status http.server-fdmr.service |grep "active" >/dev/null 2>&1
then systemctl stop http.server-fdmr.service
fi
@ -966,7 +973,7 @@ if systemctl status fdmr_mon2.service |grep active >/dev/null 2>&1
then sudo systemctl stop fdmr_mon2.service
fi
if systemctl status proxy.service |grep active >/dev/null 2>&1
if systemctl status proxy.service |grep "active" >/dev/null 2>&1
then sudo systemctl stop proxy.service
fi
@ -1074,20 +1081,24 @@ Restart=on-failure
WantedBy=multi-user.target
EOF
variable1=$(grep "Web-Dashboar-Port:" /opt/wdp | grep -Eo '[A.0-9]{1,9}') &&
if [ -z "$variable1" ]
then variable1=80
fi &&
sudo sed -i "s/ExecStart=.*/ExecStart=php -S 0.0.0.0:$variable1 -t \/var\/www\/fdmr\//g" /lib/systemd/system/http.server-fdmr.service &&
sudo sed -i "s/ExecStart=.*/ExecStart=php -S 0.0.0.0:$variable1 -t \/var\/www\/fdmr2\//g" /lib/systemd/system/http.server-fdmr2.service &&
systemctl daemon-reload &&
#####################################
if systemctl status mariadb.service |grep inactive >/dev/null 2>&1
then sudo systemctl start mariadb.service
fi
if systemctl status mariadb.service |grep disable >/dev/null 2>&1
then sudo systemctl enable mariadb.service
fi
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 "service; enabled;" >/dev/null 2>&1; then
sudo systemctl enable http.server-fdmr2.service
fi
if systemctl status fdmr_mon.service |grep "service; enabled;" >/dev/null 2>&1
then sudo systemctl disable fdmr_mon.service
@ -1100,22 +1111,22 @@ if ! systemctl status proxy.service | grep "service; enabled;" >/dev/null 2>&1;
sudo systemctl enable proxy.service
fi
#####################################
if sudo systemctl status http.server-fdmr.service |grep "service; enabled;" >/dev/null 2>&1
then
variable1=$(grep "Web-Dashboar-Port:" /opt/wdp | grep -Eo '[A.0-9]{1,9}') &&
if [ -z "$variable1" ]
then variable1=80
fi &&
sudo sed -i "s/ExecStart=.*/ExecStart=php -S 0.0.0.0:$variable1 -t \/var\/www\/fdmr\//g" /lib/systemd/system/http.server-fdmr.service &&
sudo sed -i "s/ExecStart=.*/ExecStart=php -S 0.0.0.0:$variable1 -t \/var\/www\/fdmr2\//g" /lib/systemd/system/http.server-fdmr2.service &&
systemctl daemon-reload &&
systemctl restart fdmr_mon2.service
systemctl restart proxy.service
systemctl restart http.server-fdmr2.service
variable1=$(grep "Web-Dashboar-Port:" /opt/wdp | grep -Eo '[A.0-9]{1,9}') &&
if [ -z "$variable1" ]
then variable1=80
fi &&
sudo sed -i "s/ExecStart=.*/ExecStart=php -S 0.0.0.0:$variable1 -t \/var\/www\/fdmr\//g" /lib/systemd/system/http.server-fdmr.service &&
sudo sed -i "s/ExecStart=.*/ExecStart=php -S 0.0.0.0:$variable1 -t \/var\/www\/fdmr2\//g" /lib/systemd/system/http.server-fdmr2.service &&
systemctl daemon-reload &&
systemctl start fdmr_mon2.service
systemctl start proxy.service
systemctl start http.server-fdmr2.service
sh /opt/extra-2.sh
fi
(crontab -l; echo "* */1 * * * sync ; echo 3 > /proc/sys/vm/drop_caches >/dev/null 2>&1")|awk '!x[$0]++'|crontab -
cronedit.sh '*/5 * * * *' 'sh /opt/FDMR-Monitor/sysinfo/graph.sh' remove &&
cronedit.sh '*/2 * * * *' 'sh /opt/FDMR-Monitor/sysinfo/cpu.sh' remove &&
cronedit.sh '*/5 * * * *' 'sh /etc/freedmr/hbmon/sysinfo/graph.sh' remove &&

Loading…
Cancel
Save

Powered by TurnKey Linux.