This commit is contained in:
Esteban Mackay Q 2023-08-29 11:13:30 -05:00
parent 66f3460af7
commit 0d8b66bd78
5 changed files with 172 additions and 24 deletions

View File

@ -168,6 +168,7 @@ bash -c "$(curl -fsSL https://gitlab.com/hp3icc/python-aprs-wx/-/raw/main/instal
bash -c "$(curl -fsSL https://gitlab.com/hp3icc/emq-TE1/-/raw/main/install/ysf2ysf.sh)"
bash -c "$(curl -fsSL https://gitlab.com/hp3icc/emq-TE1/-/raw/main/install/raspberry.sh)"
bash -c "$(curl -fsSL https://gitlab.com/hp3icc/easy-hbl/-/raw/main/hbl.sh)"
bash -c "$(curl -fsSL https://gitlab.com/hp3icc/emq-TE1/-/raw/main/install/nxdn2dmr.sh)"
###########################
@ -189,6 +190,7 @@ bash -c "$(curl -fsSL https://gitlab.com/hp3icc/emq-TE1/-/raw/main/menu/menu-ysf
bash -c "$(curl -fsSL https://gitlab.com/hp3icc/emq-TE1/-/raw/main/menu/menu-ufw)"
bash -c "$(curl -fsSL https://gitlab.com/hp3icc/emq-TE1/-/raw/main/menu/menu-ysf2ysf)"
bash -c "$(curl -fsSL https://gitlab.com/hp3icc/easy-hbl/-/raw/main/menu-hbl.sh)"
bash -c "$(curl -fsSL https://gitlab.com/hp3icc/emq-TE1/-/raw/main/menu/menu-nxdn2dmr)"
############################

95
install/nxdn2dmr.sh Normal file
View File

@ -0,0 +1,95 @@
#!/bin/bash
if [ -d "/opt/NXDN2DMR/" ]
then
rm -r /opt/NXDN2DMR/
fi
if [ -d "/var/log/nxdn2dmr" ]
then
echo "found dir"
else
mkdir /var/log/nxdn2dmr
fi
cp -r /opt/MMDVM_CM/NXDN2DMR/ /opt/
sudo chmod +x /opt/NXDN2DMR/*
###########################
cat > /lib/systemd/system/nxdn2dmr.service <<- "EOF"
[Unit]
Description=NXDN2DMR Service
After=syslog.target network.target
[Service]
#User=root
#Type=simple
#Restart=always
#RestartSec=3
#StandardOutput=null
WorkingDirectory=/opt/NXDN2DMR
#ExecStartPre=/bin/sleep 15
ExecStart=/opt/NXDN2DMR/NXDN2DMR /opt/NXDN2DMR/NXDN2DMR.ini
Restart=on-failure
[Install]
WantedBy=multi-user.target
EOF
###########################
cat > /opt/NXDN2DMR/NXDN2DMR.ini <<- "EOF"
[Info]
RXFrequency=0
TXFrequency=0
Power=1
Latitude=0.0
Longitude=0.0
Height=0
Location=NXDN Bridge
Description=Multi-Mode Repeater
URL=www.google.co.uk
[NXDN Network]
Callsign=NOCALL
TG=9
DstAddress=100.100.100.100
DstPort=41400
LocalAddress=127.0.0.1
#LocalPort=42022
DefaultID=7336
Daemon=0
[DMR Network]
Id=123456789
#XLXFile=XLXHosts.txt
#XLXReflector=950
#XLXModule=D
StartupDstId=7144
# For TG call: StartupPC=0
StartupPC=0
Address=127.0.0.1
Port=62031
Jitter=500
# Local=62032
Password=passw0rd
Options=
#TS2=9;DIAL=0;VOICE=0;LANG=es_ES;SINGLE=1;TIMER=0;
#XLX:4001
Debug=0
[DMR Id Lookup]
File=/opt/data-files/DMRIds.dat
Time=24
[NXDN Id Lookup]
File=/opt/data-files/NXDN.csv
Time=24
[Log]
# Logging levels, 0=No logging
DisplayLevel=1
FileLevel=0
FilePath=.
FileRoot=NXDN2DMR
EOF
#######################################################################################################################
systemctl daemon-reload

View File

@ -8,22 +8,23 @@ if [[ $EUID -ne 0 ]]; then
fi
while : ; do
choix=$(whiptail --title "Proyect emq-TE1+ Rev: R00ab / Raspbian Proyect by HP3ICC 73." --menu "Suba o Baje con las flechas del teclado y seleccione el numero de opcion:" 24 70 15 \
choix=$(whiptail --title "Proyect emq-TE1+ Rev: R00ab / Raspbian Proyect by HP3ICC 73." --menu "Suba o Baje con las flechas del teclado y seleccione el numero de opcion:" 24 70 16 \
1 " APRS " \
2 " MMDVMHost " \
3 " Dvswitch " \
4 " pYSFReflector3 " \
5 " YSF2DMR " \
6 " YSF2YSF " \
7 " HBLink3 Server " \
8 " FreeDMR Server " \
9 " Editar WiFi " \
10 " DDNS NoIP " \
11 " GoTTY " \
12 " Firewall " \
13 " Update " \
14 " Reiniciar Equipo " \
15 " Salir del menu " 3>&1 1>&2 2>&3)
5 " NXDN2DMR " \
6 " YSF2DMR " \
7 " YSF2YSF " \
8 " HBLink3 Server " \
9 " FreeDMR Server " \
10 " Editar WiFi " \
11 " DDNS NoIP " \
12 " GoTTY " \
13 " Firewall " \
14 " Update " \
15 " Reiniciar Equipo " \
16 " Salir del menu " 3>&1 1>&2 2>&3)
exitstatus=$?
#on recupere ce choix
#exitstatus=$?
@ -43,26 +44,28 @@ menu-dvs;;
4)
menu-ysf;;
5)
menu-ysf2dmr;;
menu-nxdn2dmr;;
6)
menu-ysf2ysf;;
menu-ysf2dmr;;
7)
menu-hbl;;
menu-ysf2ysf;;
8)
menu-fdmr;;
menu-hbl;;
9)
menu-wifi;;
menu-fdmr;;
10)
menu-noip ;;
menu-wifi;;
11)
menu-web ;;
menu-noip ;;
12)
menu-ufw ;;
menu-web ;;
13)
bash -c "$(curl -fsSL https://gitlab.com/hp3icc/emq-TE1/-/raw/main/update.sh)" ;;
menu-ufw ;;
14)
menu-reboot ;;
bash -c "$(curl -fsSL https://gitlab.com/hp3icc/emq-TE1/-/raw/main/update.sh)" ;;
15)
menu-reboot ;;
16)
break;
esac
done

48
menu/menu-nxdn2dmr Normal file
View File

@ -0,0 +1,48 @@
#!/bin/bash
sudo cat > /bin/menu-nxdn2dmr <<- "EOF"
#!/bin/bash
while : ; do
choix=$(whiptail --title "Raspbian Proyect HP3ICC Menu NXDN2DMR" --menu "Suba o Baje con las flechas del teclado y seleccione el numero de opcion" 20 50 11 \
1 " Editar NXDN2DMR " \
2 " Iniciar NXDN2DMR " \
3 " Detener NXDN2DMR " \
4 " Menu Principal " 3>&1 1>&2 2>&3)
exitstatus=$?
#on recupere ce choix
#exitstatus=$?
if [ $exitstatus = 0 ]; then
echo "Your chosen option:" $choix
else
echo "You chose cancel."; break;
fi
# case : action en fonction du choix
case $choix in
1)
sudo nano /opt/NXDN2DMR/NXDN2DMR.ini;;
2)
sh /opt/data-file.sh && (crontab -l; echo "* */24 * * * sh /opt/data-file.sh")|awk '!x[$0]++'|crontab - &&
if systemctl status nxdn2dmr.service |grep active >/dev/null 2>&1
then sudo systemctl stop nxdn2dmr.service
fi
if systemctl status nxdn2dmr.service |grep disable >/dev/null 2>&1
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 "sh /opt/data-file.sh") | crontab -
fi
sudo systemctl stop nxdn2dmr.service && sudo systemctl disable nxdn2dmr.service ;;
4)
break;
esac
done
exit 0
EOF
###
chmod +x /bin/menu-nxdn2dmr
ln -sf /bin/menu-nxdn2dmr /bin/MENU-NXDN2DMR
chmod +x /bin/MENU*

View File

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