Update update.sh

merge-requests/1/head
Esteban Mackay Q 2 years ago
parent c10b9a5dc1
commit 0835a91e6f

@ -1016,29 +1016,6 @@ fi
# service update # service update
############################################################ ############################################################
cat > /lib/systemd/system/fdmr_mon2.service <<- "EOF"
[Unit]
Description=FDMR Monitor2
# To make the network-online.target available
# systemctl enable systemd-networkd-wait-online.service
#After=network-online.target syslog.target
#Wants=network-online.target
[Service]
#User=root
#Type=simple
#Restart=always
#RestartSec=3
#StandardOutput=null
WorkingDirectory=/opt/FDMR-Monitor2
ExecStart=python3 /opt/FDMR-Monitor2/monitor.py
#Restart=on-abort
Restart=on-failure
[Install]
WantedBy=multi-user.target
EOF
cat > /lib/systemd/system/http.server-fdmr2.service <<- "EOFH" cat > /lib/systemd/system/http.server-fdmr2.service <<- "EOFH"
[Unit] [Unit]
Description=PHP http.server.fdmr2 Description=PHP http.server.fdmr2
@ -1088,7 +1065,7 @@ sed -i "s/test/selfcare/g" /opt/FDMR-Monitor2/fdmr-mon_SAMPLE.cfg
sed -i "s/PRIVATE_NETWORK = True/PRIVATE_NETWORK = False/g" /opt/FDMR-Monitor2/fdmr-mon_SAMPLE.cfg sed -i "s/PRIVATE_NETWORK = True/PRIVATE_NETWORK = False/g" /opt/FDMR-Monitor2/fdmr-mon_SAMPLE.cfg
sed -i "s/SUBSCRIBER_FILE =.*/SUBSCRIBER_FILE = subscriber_ids.csv/g" /opt/FDMR-Monitor2/fdmr-mon_SAMPLE.cfg sed -i "s/SUBSCRIBER_FILE =.*/SUBSCRIBER_FILE = subscriber_ids.csv/g" /opt/FDMR-Monitor2/fdmr-mon_SAMPLE.cfg
sed -i "s/FILES_PATH =.*/FILES_PATH = \/opt\/FDMR-Monitor2\/data/g" /opt/FDMR-Monitor2/fdmr-mon_SAMPLE.cfg sed -i "s/FILES_PATH =.*/FILES_PATH = \/opt\/FDMR-Monitor2\/data/g" /opt/FDMR-Monitor2/fdmr-mon_SAMPLE.cfg
sed -i "s/configFile =.*/configFile = '\/opt\/FDMR-Monitor2\/fdmr-mon.cfg';/g" /opt/FDMR-Monitor2/html/config.php
sed -i "s/with.*/with <a href=\"https:\/\/github.com\/CS8ABG\/FDMR-Monitor\" target=\"_blank\">FDMR-Monitor2<\/a> by <a title=\"CS8ABG Dash v23.07ss\" href=\"http:\/\/www.qrz.com\/db\/CS8ABG\">CS8ABG<\/a> , Proyect: <a href=\"https:\/\/gitlab.com\/hp3icc\/fdmr\/\" target=\"_blank\">FDMR+<\/a><\/div>/g" /opt/FDMR-Monitor2/html/include/footer.php sed -i "s/with.*/with <a href=\"https:\/\/github.com\/CS8ABG\/FDMR-Monitor\" target=\"_blank\">FDMR-Monitor2<\/a> by <a title=\"CS8ABG Dash v23.07ss\" href=\"http:\/\/www.qrz.com\/db\/CS8ABG\">CS8ABG<\/a> , Proyect: <a href=\"https:\/\/gitlab.com\/hp3icc\/fdmr\/\" target=\"_blank\">FDMR+<\/a><\/div>/g" /opt/FDMR-Monitor2/html/include/footer.php
sed -i "s/#fff/#d1d1d1/g" /opt/FDMR-Monitor2/html/plugins/adminlte/css/adminlte.min.css sed -i "s/#fff/#d1d1d1/g" /opt/FDMR-Monitor2/html/plugins/adminlte/css/adminlte.min.css
sed -i "s/f8f9fa/d0d0d0/g" /opt/FDMR-Monitor2/html/plugins/adminlte/css/adminlte.min.css sed -i "s/f8f9fa/d0d0d0/g" /opt/FDMR-Monitor2/html/plugins/adminlte/css/adminlte.min.css
@ -1115,8 +1092,16 @@ sed -i "s/ExecStart=.*/ExecStart=python3 \/opt\/FDMR-Monitor2\/monitor.py/g" /op
sudo cp /opt/FDMR-Monitor2/utils/logrotate/fdmr_mon2 /etc/logrotate.d/fdmr_mon2 sudo cp /opt/FDMR-Monitor2/utils/logrotate/fdmr_mon2 /etc/logrotate.d/fdmr_mon2
#sudo cp /opt/FDMR-Monitor2/utils/systemd/fdmr_mon2.service /lib/systemd/system/fdmr_mon2.service sudo cp /opt/FDMR-Monitor2/utils/systemd/fdmr_mon2.service /lib/systemd/system/fdmr_mon2.service
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 [ -f "mon.db" ] if [ -f "mon.db" ]
then then
rm mon.db rm mon.db
@ -1134,14 +1119,7 @@ python3 mon_db.py --update
##################################### #####################################
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 if systemctl status http.server-fdmr.service |grep "service; enabled;" >/dev/null 2>&1
then sudo systemctl disable http.server-fdmr.service then sudo systemctl disable http.server-fdmr.service
@ -1166,9 +1144,9 @@ variable1=$(grep "Web-Dashboar-Port:" /opt/wdp | grep -Eo '[A.0-9]{1,9}') &&
if [ -z "$variable1" ] if [ -z "$variable1" ]
then variable1=80 then variable1=80
fi && 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\/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 && 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 daemon-reload &&
systemctl start fdmr_mon2.service systemctl start fdmr_mon2.service

Loading…
Cancel
Save

Powered by TurnKey Linux.