This commit is contained in:
Esteban Mackay Q 2023-10-17 23:26:12 -05:00
parent 2929e33761
commit aecf3fc7db
11 changed files with 62 additions and 27 deletions

View File

@ -109,7 +109,7 @@ Imagen para raspberry, proyecto emq-TE1 - recomendado para cualquier Raspberry :
Puede instalar en su sistema operativo (Ubuntu , raspberry , Debian ) utilizando el Bash de auto instalación desde su consola terminal con permisos de super usuario, importante su sistema operativo debe tener instalado sudo y curl antes de utilizar el Bash de auto instalación .
* Ultima revision de scrip 16/10/2023
* Ultima revision de scrip 17/10/2023
* Bash de auto instalación :

View File

@ -159,6 +159,7 @@ bash -c "$(curl -fsSL https://gitlab.com/hp3icc/fdmr/-/raw/main/fdmr-bridge.sh)"
bash -c "$(curl -fsSL https://gitlab.com/hp3icc/emq-TE1/-/raw/main/install/nxdn2dmr.sh)" &&
bash -c "$(curl -fsSL https://gitlab.com/hp3icc/emq-TE1/-/raw/main/install/p25.sh)" &&
bash -c "$(curl -fsSL https://gitlab.com/hp3icc/emq-TE1/-/raw/main/install/p25cross.sh)" &&
bash -c "$(curl -fsSL https://gitlab.com/hp3icc/emq-TE1/-/raw/main/menu/data-mmdvm.sh)"
echo install menu
bash -c "$(curl -fsSL https://gitlab.com/hp3icc/emq-TE1/-/raw/main/menu/menu)" &&
bash -c "$(curl -fsSL https://gitlab.com/hp3icc/emq-TE1/-/raw/main/menu/menu-aprs)" &&

View File

@ -624,11 +624,6 @@ WantedBy=multi-user.target
EOF
#
#####################################################################################################################
bash -c "$(curl -fsSL https://gitlab.com/hp3icc/emq-TE1/-/raw/main/menu/data-mmdvm.sh)"
###############################################################################################################################
systemctl daemon-reload

View File

@ -53,7 +53,7 @@ sudo rm -r /opt/DVReflectors
#sudo chmod +x /usr/local/bin/P25Reflector.sh
#sudo sed -i "s/PROG_ARGS=.*/PROG_ARGS=\"\/opt\/P25Reflector\/P25Reflector.ini\"/g" /usr/local/bin/P25Reflector.sh
sudo sed -i "s/FilePath=.*/FilePath=\/var\/log\/P25Reflector/g" /opt/P25Reflector/P25Reflector.ini
sudo sed -i "s/Name=.*/Name=\/var\/lib\/mmdvm\/DMRIds.dat/g" /opt/P25Reflector/P25Reflector.ini
sudo sed -i "s/Name=.*/Name=\/opt\/data-files\/DMRIds.dat/g" /opt/P25Reflector/P25Reflector.ini
sudo sed -i "s/Daemon=.*/Daemon=0/g" /opt/P25Reflector/P25Reflector.ini
cp /opt/P25Reflector/P25Reflector.ini /etc/P25Reflector.ini
#/usr/local/bin/P25Reflector.sh stop

View File

@ -135,7 +135,7 @@ FilePath=/var/log/mmdvm
FileRoot=MMDVM_Bridge
[DMR Id Lookup]
File=/var/lib/mmdvm/DMRIds.dat
File=/opt/data-files/DMRIds.dat
Time=24
[NXDN Id Lookup]
@ -227,7 +227,7 @@ Debug=0
Daemon=0
[Id Lookup]
Name=/var/lib/mmdvm/DMRIds.dat
Name=/opt/data-files/DMRIds.dat
Time=24
[Voice]

View File

@ -195,7 +195,7 @@ Daemon=0
[DMR Network]
Id=000000000
#XLXFile=/opt/data-files/XLXHosts.txtt
#XLXFile=/opt/data-files/XLXHosts.txt
#XLXReflector=744
#XLXModule=A
StartupDstId=9

View File

@ -103,4 +103,53 @@ then
mkdir /opt/data-files
chmod 777 /opt/data-files
fi
cat > /opt/mmvm.sh <<- "EOFXE"
#!/bin/bash
# Inicializamos una variable para llevar el control del tiempo
last_update=0
while true; do
# Verificamos si alguno de los servicios está activo
if systemctl is-active mmdvmh.service nxdn2dmr.service ysf2dmr.service P25Reflector.service mmdvm_bridgeP25b.service p25gatewayP25b.service; then
# Si está activo y ha pasado al menos 12 horas desde la última actualización, mostramos "actualizando"
current_time=$(date +%s)
if [ $((current_time - last_update)) -ge 43200 ]; then
/usr/bin/python3 /opt/data-mmdvm.py
# Actualizamos el tiempo de la última actualización
last_update=$current_time
fi
else
# Si todos los servicios están inactivos, limpiamos la variable last_update
last_update=0
fi
sleep 60 # Espera 1 minuto antes de la próxima verificación
done
EOFXE
chmod +x /opt/mmvm.sh
cat > /lib/systemd/system/data-mmdvm.service <<- "EOFXD"
[Unit]
Description=data-mmdvm
After=multi-user.target
After=network.target
[Service]
ExecStart=/bin/bash /opt/mmvm.sh
Restart=on-failure
[Install]
WantedBy=multi-user.target
EOFXD
systemctl daemon-reload
if systemctl is-active data-mmdvm.service; then
systemctl stop data-mmdvm.service
systemctl start data-mmdvm.service
else
systemctl start data-mmdvm.service
systemctl enable data-mmdvm.service
fi
python3 /opt/data-mmdvm.py

View File

@ -48,13 +48,13 @@ sudo nano /opt/YSFGateway2/YSFGateway.ini;;
4)
sudo nano /opt/YSF2DMRGW/YSF2DMR.ini;;
5)
python3 /opt/data-mmdvm.py && cronedit.sh '* */24 * * *' 'python3 /opt/data-mmdvm.py' add
sudo systemctl stop mmdvmh.service
if cat /opt/MMDVMHost/MMDVM.ini | grep ServiceStart=0 >/dev/null 2>&1
then
sudo systemctl disable mmdvmh.service
elif cat /opt/MMDVMHost/MMDVM.ini | grep ServiceStart=1 >/dev/null 2>&1
then
python3 /opt/data-mmdvm.py &&
sudo systemctl start mmdvmh.service
sudo systemctl enable mmdvmh.service
fi
@ -90,10 +90,6 @@ then
fi
;;
6)
if systemctl status ysf2dmr.service | grep disable >/dev/null 2>&1
then
cronedit.sh '* */24 * * *' 'python3 /opt/data-mmdvm.py' remove
fi
sudo systemctl stop mmdvmh.service && sudo systemctl disable mmdvmh.service && systemctl stop ysf2dmrgw.service && sudo systemctl stop dmrgw.service ;;
7)
if sudo systemctl status http.server-mmdvmh.service |grep "service; enabled;" >/dev/null 2>&1

View File

@ -20,7 +20,7 @@ case $choix in
1)
sudo nano /opt/NXDN2DMR/NXDN2DMR.ini;;
2)
python3 /opt/data-mmdvm.py && (crontab -l; echo "* */24 * * * python3 /opt/data-mmdvm.py")|awk '!x[$0]++'|crontab - &&
python3 /opt/data-mmdvm.py &&
if systemctl status nxdn2dmr.service |grep active >/dev/null 2>&1
then sudo systemctl stop nxdn2dmr.service
@ -31,10 +31,6 @@ then sudo systemctl enable nxdn2dmr.service
fi
sudo systemctl start nxdn2dmr.service ;;
3)
if systemctl status mmdvmh.service | grep disable >/dev/null 2>&1
then
(crontab -l | grep -v "python3 /opt/data-mmdvm.py") | crontab -
fi
sudo systemctl stop nxdn2dmr.service && sudo systemctl disable nxdn2dmr.service ;;
4)
break;

View File

@ -40,6 +40,7 @@ case $choix in
1)
sudo nano /etc/P25Reflector.ini ;;
2)
python3 /opt/data-mmdvm.py &&
sudo systemctl stop P25Reflector.service &&
if ! sudo systemctl status P25Reflector.service |grep "service; enabled;" >/dev/null 2>&1
then
@ -316,12 +317,12 @@ case $choix in
sudo sed -i "37s/Static=.*/Static=$p25id/g" /opt/p25bridge/P25Gateway.ini
sudo sed -i "38s/Startup=.*/Startup=$p25id/g" /opt/p25bridge/P25Gateway.ini
input_file="/var/lib/mmdvm/P25Hosts.txt"
input_file="/opt/data-files/P25Hosts.txt"
output_file="/opt/P25Hosts2.txt"
grep -w "^$p25id" "$input_file" > "$output_file"
rm -f /tmp/mcall.txt /tmp/mid.txt /tmp/p25id.txt /tmp/sbridge.txt /tmp/sport.txt /tmp/sopti.txt /tmp/midg.txt /tmp/spass.txt
python3 /opt/data-mmdvm.py
#!/bin/bash
# Lista de servicios a reiniciar
@ -344,6 +345,7 @@ done
;;
2)
python3 /opt/data-mmdvm.py
#!/bin/bash
# Lista de servicios a reiniciar

View File

@ -20,7 +20,7 @@ case $choix in
1)
sudo nano /opt/YSF2DMR/YSF2DMR.ini;;
2)
python3 /opt/data-mmdvm.py && (crontab -l; echo "* */24 * * * python3 /opt/data-mmdvm.py")|awk '!x[$0]++'|crontab - &&
python3 /opt/data-mmdvm.py &&
if systemctl status ysf2dmr.service |grep active >/dev/null 2>&1
then sudo systemctl stop ysf2dmr.service
@ -31,10 +31,6 @@ then sudo systemctl enable ysf2dmr.service
fi
sudo systemctl start ysf2dmr.service ;;
3)
if systemctl status mmdvmh.service | grep disable >/dev/null 2>&1
then
(crontab -l | grep -v "python3 /opt/data-mmdvm.py") | crontab -
fi
sudo systemctl stop ysf2dmr.service && sudo systemctl disable ysf2dmr.service ;;
4)
break;