Start  docker, 

docker run -it --name freedmr-hytera  hacknix/freedmr-hytera:development-latest
 
Enter docekr
docker exec -it -u root freedmr-hytera-bridge /bin/sh

 cat /opt/DMRGateway.ini
[General]
Timeout=10
RptProtocol=old
RptAddress=127.0.0.1
RptPort=64032
LocalAddress=127.0.0.1
LocalPort=64031
Split=2
RuleTrace=1
Daemon=0
Debug=0


[Log]
DisplayLevel=1
FileLevel=1
FilePath=/var/log/
FileRoot=DMRGateway
FileRotate=1


[Voice]
Enabled=0
Language=en_GB
Directory=./Audio


[Info]
Latitude=0.0
Longitude=0.0
Height=0
Location=Nowhere
Description=Multi-Mode Repeater
URL=www.google.co.uk


[XLX Network]
Enabled=0
File=XLXHosts.txt
Port=62030
Password=passw0rd
ReloadTime=60
# Local=3351
Slot=1
TG=6
Base=64000
Startup=950
Relink=10
Debug=0
UserControl=1


[DMR Network 1]
Enabled=1
Address=172.17.0.1
Port=62031
TGRewrite0=2,8,2,9,1
PCRewrite0=2,94000,2,4000,1001
TypeRewrite0=2,9990,2,9990
SrcRewrite0=2,4000,2,9,1001
PassAllPC0=1
PassAllTG0=1
PassAllPC1=2
PassAllTG1=2
Password="passw0rd"
Debug=0
Id=765432133
Location=0
Name=FreeDMR_ADN_x
Options="TS2=460753;TIMER=15"

# FreeDMR
#[DMR Network 1]
#Enabled=1
#Name=FreeDMR
#Address=
#Port=62031
##TGRewrite=1,9,1,{{DMRG_REWRITETS1TG9}},1
#PCRewrite=1,4000,2,4000,1
#PCRewrite=2,80,2,80,4977
#PCRewrite=2,5058,2,5058,4932
#PCRewrite=2,9991,2,9991,225008
#PCRewrite=2,235000,2,235000,1000
#PCRewrite=2.236000,2,23600,764000
#PassAllTG=1
#PassAllTG=2
#Password=passw0rd
#Location=1
#Debug=0
#Options=


[DMR Network 2]
Enabled=0


[DMR Network 3]
Enabled=0


[DMR Network 4]
Enabled=0


[DMR Network 5]
Enabled=0


[Dynamic TG Control]
Enabled=0
Port=3769


cat /opt/settings.ini
# Hytera IPSC configuration
[ip-site-connect]
# Local IP on which you listen for Hytera repeater connection
ip = 0.0.0.0
p2p_port = 50000
dmr_port = 50001
rdac_port = 50002


[homebrew]
# valid values are
# homebrew - 2015 PDF specification (DL5DI, G4KLX, DG1HT 2015) - for Brandmeister
# mmdvm - for HBLink/HBlink3, DMRGateway before 8/2020 and others
# dmrgateway - for DMRGateway versions since 9/2020
protocol = dmrgateway
# from which IP the connection to MMDVM is made
local_ip = 127.0.0.1
local_port = 64032
# master ip, port and password
master_ip = 127.0.0.1
master_port = 64031
password = passw0rd


# callsign and repeater_dmr_id, if provided will override the one read from repeater
callsign =
repeater_dmr_id =  
# params for configuration reporting
color_code = 1
latitude = {{latitude}}
longitude = {
antenna_height =
# 20 ascii letters, will be trimmed if exceeded
location =
description =
# 124 ascii letters, https:// not required, will be trimmed if exceeded
url = www.freedmr.uk
# 40 ascii letters, will be trimmed if exceeded
software_id = 2021.2
package_id = Hytera Homebrew Bridge
# use these to override params read out of repeater
rx_freq =
tx_freq =
tx_power =
# 1 = only TS1, 2 = only TS2, 3 = TS1 and TS2
timeslots =
# we default to generating random stream ids for outgoing traffic, but you can change the behavior
use_random_stream_id = True

cat start_dmrgateway.sh
cd /opt/DMRGateway
nohup /opt/DMRGateway/DMRGateway /opt/DMRGateway.ini &
echo "log to /var/log/"

cat start_bridge.sh
#python /usr/local/bin/hytera-homebrew-bridge.py /opt/settings.ini
nohup python /usr/local/bin/hytera-homebrew-bridge.py /opt/settings.ini >> /var/log/hytera-homebrew-bridge.log 2>&1 &

cat entrypoint
#!/bin/sh

#Check if a template is mapped and if so, copy it in
if [ -r "/opt/DMRGateway.tmpl" ]
then
        echo DMRGateway template file found - copying...
        cp -v /opt/DMRGateway.tmpl /opt/DMRGateway.ini
fi
#Check if a template is mapped and if so, copy it in
if [ -r "/opt/settings.tmpl" ]
then
        echo Hytera settings template file found - copying...
        cp -v /opt/settings.tmpl /opt/settings.ini
fi

#Substitute enivronment variables into files

sed -i "s/{{callsign}}/$callsign/" /opt/settings.ini
sed -i "s/{{repeater_dmr_id}}/$repeater_dmr_id/" /opt/settings.ini
sed -i "s/{{color_code}}/$color_code/" /opt/settings.ini
sed -i "s/{{latitude)}/$latitude/" /opt/settings.ini
sed -i "s/{longitude}}/$longitude/" /opt/settings.ini
sed -i "s/{{antenna_height}}/$antenna_height/" /opt/settings.ini
sed -i "s/{{location}}/$location/" /opt/settings.ini
sed -i "s/{{description}}/$description/" /opt/settings.ini
sed -i "s/{{rx_freq}}/$rx_freq/" /opt/settings.ini
sed -i "s/{{tx_freq}}/$tx_freq/" /opt/settings.ini
sed -i "s/{{tx_power}}/$tx_power/" /opt/settings.ini
sed -i "s/{{timeslots}}/$timeslots/" /opt/settings.ini


sed -i "s/{{DMRG_OPTIONS}}/$DMRG_OPTIONS/" /opt/DMRGateway.ini
sed -i "s/{{DMRG_TARGET}}/$DMRG_TARGET/" /opt/DMRGateway.ini


#Add rewrite for TS1 TG9 is required
if [ "$DMRG_REWRITETS1TG9" != "" ]
then
        echo 'Setting TS1 rewrite 23590 <-> 9...'
        sed -i "s/{{DMRG_REWRITETS1TG9}}/$DMRG_REWRITETS1TG9/" /opt/DMRGateway.ini
        sed -i "s/#TGRewrite=/TGRewrite=/" /opt/DMRGateway.ini
fi


#Disable dial a TG only on TS2 if required
if [ "$DMRG_DISABLEDIAL" == 1 ]
then
        echo 'Disable Dial-a-TG only on slot2...'
        sed -i "s/TypeRewrite=/#TypeRewrite/" /opt/DMRGateway.ini
fi

#Run processes


#python /usr/local/bin/hytera-homebrew-bridge.py /opt/settings.ini


#cd /opt/DMRGateway


#/opt/DMRGateway/DMRGateway /opt/DMRGateway.ini


#/bin/ash
#tail -f /var/log/os.log


mkdir -p /var/log
chmod 777 -R /var/log
sh /start_dmrgateway.sh
sh /start_bridge.sh
sh /viewlog_dmrgateway.sh