merge-requests/1/head
Esteban Mackay Q 2 years ago
parent fbfd12313f
commit 48eed8dca4

@ -84,15 +84,12 @@ rustup default 1.72.0
echo "Instalación completa." echo "Instalación completa."
####### #######
bash -c "$(curl -fsSLk https://gitlab.com/hp3icc/emq-TE1/-/raw/main/install/nginx.sh)"
bash -c "$(curl -fsSLk https://gitlab.com/hp3icc/fdmr/-/raw/main/install.sh)" bash -c "$(curl -fsSLk https://gitlab.com/hp3icc/fdmr/-/raw/main/install.sh)"
sudo systemctl start freedmr.service sudo systemctl start freedmr.service
sudo systemctl enable freedmr.service sudo systemctl enable freedmr.service
sudo systemctl start proxy.service sudo systemctl start proxy.service
sudo systemctl enable proxy.service sudo systemctl enable proxy.service
sudo systemctl start fdmr_mon.service
sudo systemctl enable fdmr_mon.service
sudo systemctl start fdmrparrot.service sudo systemctl start fdmrparrot.service
sudo systemctl enable fdmrparrot.service sudo systemctl enable fdmrparrot.service
sudo systemctl start http.server-fdmr.service
sudo systemctl enable http.server-fdmr.service
menu-fdmr menu-fdmr

@ -432,23 +432,6 @@ sh /opt/FDMR-Monitor-B/sysinfo/rrd-db.sh
################## ##################
#Service #Service
########## ##########
sudo cat > /lib/systemd/system/http.server-fdmr-b.service <<- "EOF"
[Unit]
Description=PHP http.server.fdmr
After=network.target
[Service]
#User=root
#ExecStartPre=/bin/sleep 30
# Modify for different other port
ExecStart=php -S 0.0.0.0:80 -t /var/www/fdmr-b/
Restart=on-failure
[Install]
WantedBy=multi-user.target
EOF
#
sudo cat > /lib/systemd/system/proxy2.service <<- "EOF" sudo cat > /lib/systemd/system/proxy2.service <<- "EOF"
[Unit] [Unit]
Description= Proxy Service Bridge Description= Proxy Service Bridge
@ -512,20 +495,21 @@ if [ -d "/opt/FDMR-Monitor-B2" ]
then then
rm -r /opt/FDMR-Monitor-B2 rm -r /opt/FDMR-Monitor-B2
fi fi
if [ -f "/opt/wdp7" ] if ! grep -q "Web-Dashboar-name" "/opt/wdp7" > /dev/null 2>&1; then
then cat > /opt/wdp7 <<- "EOFX"
echo "found file" ################################################
else # Select number port, FreeDMR-Bridge Dashboard #
sudo cat > /opt/wdp7 <<- "EOFX" ################################################
#########################################
# Select number port, FreeDMR Dashboard #
#########################################
Web-Dashboar-name: freedmr-bidge
Web-Dashboar-Port: 80 Web-Dashboar-Port: 80
Web-Dashboar-dns:
Web-Dashboar-dir: /var/www/fdmr-b2
Web-Dashboar-select: fdmr_mon-b2
Web-Dashboar-soft: /opt/FDMR-Monitor-B2
EOFX EOFX
fi fi
cd /opt cd /opt
sudo git clone https://github.com/CS8ABG/FDMR-Monitor.git /opt/FDMR-Monitor-B2 sudo git clone https://github.com/CS8ABG/FDMR-Monitor.git /opt/FDMR-Monitor-B2
cd /opt/FDMR-Monitor-B2 cd /opt/FDMR-Monitor-B2
@ -587,21 +571,5 @@ sudo chown www-data:www-data /var/www/fdmr-b2/ -R
#python3 mon_db.py --create #python3 mon_db.py --create
#python3 mon_db.py --update #python3 mon_db.py --update
sudo cat > /lib/systemd/system/http.server-fdmr-b2.service <<- "EOF"
[Unit]
Description=PHP http.server.fdmr-b2
After=network.target
[Service]
#User=root
#ExecStartPre=/bin/sleep 30
# Modify for different other port
ExecStart=php -S 0.0.0.0:80 -t /var/www/fdmr-b2/
Restart=on-failure
[Install]
WantedBy=multi-user.target
EOF
############################# #############################
sudo systemctl daemon-reload sudo systemctl daemon-reload

@ -771,23 +771,6 @@ Restart=on-failure
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target
EOF
#
sudo cat > /lib/systemd/system/http.server-fdmr.service <<- "EOF"
[Unit]
Description=PHP http.server.fdmr
After=network.target
[Service]
#User=root
#ExecStartPre=/bin/sleep 30
# Modify for different other port
ExecStart=php -S 0.0.0.0:80 -t /var/www/fdmr/
Restart=on-failure
[Install]
WantedBy=multi-user.target
EOF EOF
# #
sudo cat > /lib/systemd/system/fdmr_mon.service <<- "EOF" sudo cat > /lib/systemd/system/fdmr_mon.service <<- "EOF"
@ -823,20 +806,6 @@ sh /opt/extra-1.sh
sh /opt/extra-2.sh sh /opt/extra-2.sh
#################################################################### ####################################################################
#monitor2 #monitor2
if [ -f "/opt/wdp" ]
then
echo "found file"
else
sudo cat > /opt/wdp <<- "EOFX"
#########################################
# Select number port, FreeDMR Dashboard #
#########################################
Web-Dashboar-Port: 80
EOFX
fi
cd /opt cd /opt
sudo git clone https://github.com/CS8ABG/FDMR-Monitor.git /opt/FDMR-Monitor2 sudo git clone https://github.com/CS8ABG/FDMR-Monitor.git /opt/FDMR-Monitor2
cd /opt/FDMR-Monitor2 cd /opt/FDMR-Monitor2
@ -927,22 +896,6 @@ cd /opt/FDMR-Monitor2
#python3 mon_db.py --create #python3 mon_db.py --create
#python3 mon_db.py --update #python3 mon_db.py --update
sudo cat > /lib/systemd/system/http.server-fdmr2.service <<- "EOF"
[Unit]
Description=PHP http.server.fdmr2
After=network.target
[Service]
#User=root
#ExecStartPre=/bin/sleep 30
# Modify for different other port
ExecStart=php -S 0.0.0.0:80 -t /var/www/fdmr2/
Restart=on-failure
[Install]
WantedBy=multi-user.target
EOF
############################# #############################
sudo systemctl daemon-reload sudo systemctl daemon-reload

@ -5,6 +5,27 @@ if [[ $EUID -ne 0 ]]; then
echo "Este script debe ejecutarse como usuario ROOT" echo "Este script debe ejecutarse como usuario ROOT"
exit 1 exit 1
fi fi
#whiptail --title "FreeDMR Bridge - Update" --msgbox "scrip sin actualizaciones disponibles / scrip no updates available" 0 50
############## ##############
#!/bin/bash
if ! grep -q "Web-Dashboar-name" "/opt/wdp7" > /dev/null 2>&1; then
sudo cat > /opt/wdp7 <<- "EOFX"
################################################
# Select number port, FreeDMR-Bridge Dashboard #
################################################
Web-Dashboar-name: freedmr-bidge
Web-Dashboar-Port: 80
Web-Dashboar-dns:
Web-Dashboar-dir: /var/www/fdmr-b2
Web-Dashboar-select: fdmr_mon-b2
Web-Dashboar-soft: /opt/FDMR-Monitor-B2
EOFX
fi
if [ -f "/etc/nginx/sites-available/000" ]; then
bash -c "$(curl -fsSLk https://gitlab.com/hp3icc/emq-TE1/-/raw/main/install/nginx.sh)"
fi
bash -c "$(curl -fsSLk https://gitlab.com/hp3icc/emq-TE1/-/raw/main/menu/menu-fdmr-bridge)"
whiptail --title "FreeDMR Bridge - Update" --msgbox "scrip sin actualizaciones disponibles / scrip no updates available" 0 50 whiptail --title "FreeDMR Bridge - Update" --msgbox "scrip sin actualizaciones disponibles / scrip no updates available" 0 50

@ -8,21 +8,27 @@ fi
############## ##############
cd / cd /
################## ##################
if [ -f "/opt/wdp" ] #!/bin/bash
then if ! grep -q "Web-Dashboar-name" "/opt/wdp" > /dev/null 2>&1; then
echo "found file" sudo cat > /opt/wdp <<- "EOFX"
else
sudo cat > /opt/wdp <<- "EOFX"
#!/bin/bash #!/bin/bash
######################################### #########################################
# Select number port, FreeDMR Dashboard # # Select number port, FreeDMR Dashboard #
######################################### #########################################
Web-Dashboar-name: freedmr
Web-Dashboar-Port: 80 Web-Dashboar-Port: 80
Web-Dashboar-dns:
Web-Dashboar-dir: /var/www/fdmr2
Web-Dashboar-select: fdmr_mon2
Web-Dashboar-soft: /opt/FDMR-Monitor2
EOFX EOFX
fi fi
if [ -f "/etc/nginx/sites-available/000" ]; then
bash -c "$(curl -fsSLk https://gitlab.com/hp3icc/emq-TE1/-/raw/main/install/nginx.sh)"
fi
if [ -f "/opt/extra-1.sh" ] if [ -f "/opt/extra-1.sh" ]
then then
echo "found file" echo "found file"
@ -616,8 +622,6 @@ variable5=$(grep "COLOR_2 =" /opt/FDMR-Monitor/fdmr-mon.cfg)
##################################### #####################################
sudo systemctl stop http.server-fdmr2.service
sudo systemctl stop http.server-fdmr.service
sudo systemctl stop fdmr_mon2.service sudo systemctl stop fdmr_mon2.service
sudo systemctl stop fdmr_mon.service sudo systemctl stop fdmr_mon.service
sudo systemctl stop proxy.service sudo systemctl stop proxy.service
@ -648,22 +652,6 @@ Restart=on-failure
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target
EOF
cat > /lib/systemd/system/http.server-fdmr.service <<- "EOF"
[Unit]
Description=PHP http.server.fdmr
After=network.target
[Service]
#User=root
#ExecStartPre=/bin/sleep 30
# Modify for different other port
ExecStart=php -S 0.0.0.0:80 -t /var/www/fdmr/
Restart=on-failure
[Install]
WantedBy=multi-user.target
EOF EOF
# #
if [ -d "/var/www/fdmr" ] if [ -d "/var/www/fdmr" ]
@ -1113,11 +1101,6 @@ fi
if systemctl status mariadb.service |grep disable >/dev/null 2>&1 if systemctl status mariadb.service |grep disable >/dev/null 2>&1
then sudo systemctl enable mariadb.service then sudo systemctl enable mariadb.service
fi
sudo systemctl disable http.server-fdmr2.service
if ! systemctl status http.server-fdmr.service | grep "service; enabled;" >/dev/null 2>&1; then
sudo systemctl enable http.server-fdmr.service
fi fi
sudo systemctl disable fdmr_mon2.service sudo systemctl disable fdmr_mon2.service
if ! systemctl status fdmr_mon.service | grep "service; enabled;" >/dev/null 2>&1; then if ! systemctl status fdmr_mon.service | grep "service; enabled;" >/dev/null 2>&1; then
@ -1130,17 +1113,9 @@ fi
############## ##############
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 daemon-reload &&
systemctl start fdmr_mon.service systemctl start fdmr_mon.service
systemctl start proxy.service systemctl start proxy.service
systemctl start http.server-fdmr.service
sh /opt/extra-2.sh sh /opt/extra-2.sh
(crontab -l; echo "* */1 * * * sync ; echo 3 > /proc/sys/vm/drop_caches >/dev/null 2>&1")|awk '!x[$0]++'|crontab - (crontab -l; echo "* */1 * * * sync ; echo 3 > /proc/sys/vm/drop_caches >/dev/null 2>&1")|awk '!x[$0]++'|crontab -
@ -1165,8 +1140,6 @@ fi
############## ##############
cd / cd /
sudo systemctl stop http.server-fdmr.service
sudo systemctl stop http.server-fdmr2.service
sudo systemctl stop fdmr_mon.service sudo systemctl stop fdmr_mon.service
sudo systemctl stop fdmr_mon2.service sudo systemctl stop fdmr_mon2.service
sudo systemctl stop proxy.service sudo systemctl stop proxy.service
@ -1175,22 +1148,6 @@ sudo systemctl stop proxy.service
# service update # service update
############################################################ ############################################################
sudo cat > /lib/systemd/system/http.server-fdmr2.service <<- "EOFH"
[Unit]
Description=PHP http.server.fdmr2
After=network.target
[Service]
#User=root
#ExecStartPre=/bin/sleep 30
# Modify for different other port
ExecStart=php -S 0.0.0.0:80 -t /var/www/fdmr2/
Restart=on-failure
[Install]
WantedBy=multi-user.target
EOFH
cd / cd /
if [ -d "/var/www/fdmr2" ] if [ -d "/var/www/fdmr2" ]
then then
@ -1348,12 +1305,6 @@ python3 mon_db.py --update
##################################### #####################################
sudo systemctl disable http.server-fdmr.service
if ! systemctl status http.server-fdmr2.service | grep "service; enabled;" >/dev/null 2>&1; then
sudo systemctl enable http.server-fdmr2.service
fi
sudo systemctl disable fdmr_mon.service sudo systemctl disable fdmr_mon.service
if ! systemctl status fdmr_mon2.service | grep "service; enabled;" >/dev/null 2>&1; then if ! systemctl status fdmr_mon2.service | grep "service; enabled;" >/dev/null 2>&1; then
sudo systemctl enable fdmr_mon2.service sudo systemctl enable fdmr_mon2.service
@ -1368,13 +1319,10 @@ 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\/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
systemctl start proxy.service systemctl start proxy.service
systemctl start http.server-fdmr2.service
sh /opt/extra-3.sh sh /opt/extra-3.sh
(crontab -l; echo "* */1 * * * sync ; echo 3 > /proc/sys/vm/drop_caches >/dev/null 2>&1")|awk '!x[$0]++'|crontab - (crontab -l; echo "* */1 * * * sync ; echo 3 > /proc/sys/vm/drop_caches >/dev/null 2>&1")|awk '!x[$0]++'|crontab -

Loading…
Cancel
Save

Powered by TurnKey Linux.