2021-05-28 19:27:44 -04:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
echo FreeDMR Docker installer...
|
|
|
|
|
2021-05-31 12:50:51 -04:00
|
|
|
echo Installing required packages...
|
2021-06-16 19:04:40 -04:00
|
|
|
apt-get -y install docker.io &&
|
|
|
|
#apt-get -y install docker-compose &&
|
2021-06-17 20:52:13 -04:00
|
|
|
apt-get -y install conntrack &&
|
2021-05-28 19:27:44 -04:00
|
|
|
|
|
|
|
echo Set userland-proxy to false...
|
|
|
|
echo '{ "userland-proxy": false}' > /etc/docker/daemon.json &&
|
|
|
|
|
|
|
|
echo Restart docker...
|
|
|
|
systemctl restart docker &&
|
|
|
|
|
|
|
|
echo Pull FreeDMR latest image...
|
|
|
|
docker pull hacknix/freedmr:latest &&
|
|
|
|
|
|
|
|
echo Make config directory...
|
|
|
|
mkdir /etc/freedmr &&
|
|
|
|
chmod 755 /etc/freedmr &&
|
|
|
|
|
|
|
|
echo Install /etc/freedmr/freedmr.cfg ...
|
|
|
|
cat << EOF > /etc/freedmr/freedmr.cfg
|
|
|
|
[GLOBAL]
|
|
|
|
PATH: ./
|
|
|
|
PING_TIME: 10
|
|
|
|
MAX_MISSED: 3
|
|
|
|
USE_ACL: True
|
2021-05-31 18:48:05 -04:00
|
|
|
REG_ACL: DENY:0-100000
|
2021-05-28 19:27:44 -04:00
|
|
|
SUB_ACL: DENY:0-100000
|
|
|
|
TGID_TS1_ACL: PERMIT:ALL
|
2021-05-31 18:48:05 -04:00
|
|
|
TGID_TS2_ACL: PERMIT:ALL
|
2021-05-28 19:27:44 -04:00
|
|
|
GEN_STAT_BRIDGES: True
|
|
|
|
ALLOW_NULL_PASSPHRASE: True
|
|
|
|
ANNOUNCEMENT_LANGUAGES: en_GB,en_GB_2,en_US,es_ES,es_ES_2,fr_FR,de_DE,dk_DK,it_IT,no_NO,pl_PL,se_SE
|
|
|
|
SERVER_ID: 0
|
|
|
|
|
|
|
|
[REPORTS]
|
|
|
|
REPORT: True
|
|
|
|
REPORT_INTERVAL: 60
|
|
|
|
REPORT_PORT: 4321
|
|
|
|
REPORT_CLIENTS: *
|
|
|
|
|
|
|
|
[LOGGER]
|
|
|
|
LOG_FILE: freedmr.log
|
|
|
|
LOG_HANDLERS: file-timed
|
|
|
|
LOG_LEVEL: INFO
|
|
|
|
LOG_NAME: FreeDMR
|
|
|
|
|
|
|
|
[ALIASES]
|
|
|
|
TRY_DOWNLOAD: False
|
|
|
|
PATH: ./
|
|
|
|
PEER_FILE: peer_ids.json
|
|
|
|
SUBSCRIBER_FILE: subscriber_ids.json
|
|
|
|
TGID_FILE: talkgroup_ids.json
|
|
|
|
PEER_URL: https://www.radioid.net/static/rptrs.json
|
|
|
|
SUBSCRIBER_URL: https://www.radioid.net/static/users.json
|
2021-06-02 21:25:51 -04:00
|
|
|
TGID_URL: TGID_URL: http://downloads.freedmr.uk/downloads/talkgroup_ids.json
|
2021-05-28 19:27:44 -04:00
|
|
|
STALE_DAYS: 7
|
|
|
|
|
|
|
|
[MYSQL]
|
|
|
|
USE_MYSQL: False
|
|
|
|
USER: hblink
|
|
|
|
PASS: mypassword
|
|
|
|
DB: hblink
|
|
|
|
SERVER: 127.0.0.1
|
|
|
|
PORT: 3306
|
|
|
|
TABLE: repeaters
|
|
|
|
|
|
|
|
[OBP-TEST]
|
|
|
|
MODE: OPENBRIDGE
|
|
|
|
ENABLED: False
|
|
|
|
IP:
|
|
|
|
PORT: 62044
|
|
|
|
NETWORK_ID: 1
|
|
|
|
PASSPHRASE: mypass
|
|
|
|
TARGET_IP:
|
|
|
|
TARGET_PORT: 62044
|
|
|
|
USE_ACL: True
|
|
|
|
SUB_ACL: DENY:1
|
|
|
|
TGID_ACL: PERMIT:ALL
|
|
|
|
RELAX_CHECKS: True
|
|
|
|
ENHANCED_OBP: True
|
|
|
|
|
|
|
|
|
|
|
|
[SYSTEM]
|
|
|
|
MODE: MASTER
|
|
|
|
ENABLED: True
|
|
|
|
REPEAT: True
|
|
|
|
MAX_PEERS: 1
|
|
|
|
EXPORT_AMBE: False
|
|
|
|
IP: 127.0.0.1
|
|
|
|
PORT: 54000
|
|
|
|
PASSPHRASE:
|
|
|
|
GROUP_HANGTIME: 5
|
|
|
|
USE_ACL: True
|
|
|
|
REG_ACL: DENY:1
|
|
|
|
SUB_ACL: DENY:1
|
|
|
|
TGID_TS1_ACL: PERMIT:ALL
|
|
|
|
TGID_TS2_ACL: PERMIT:ALL
|
2021-05-31 18:48:05 -04:00
|
|
|
DEFAULT_UA_TIMER: 10
|
2021-05-28 19:27:44 -04:00
|
|
|
SINGLE_MODE: True
|
|
|
|
VOICE_IDENT: True
|
|
|
|
TS1_STATIC:
|
|
|
|
TS2_STATIC:
|
|
|
|
DEFAULT_REFLECTOR: 0
|
|
|
|
ANNOUNCEMENT_LANGUAGE: en_GB_2
|
|
|
|
GENERATOR: 100
|
|
|
|
|
|
|
|
[ECHO]
|
|
|
|
MODE: PEER
|
|
|
|
ENABLED: True
|
|
|
|
LOOSE: False
|
|
|
|
EXPORT_AMBE: False
|
|
|
|
IP: 127.0.0.1
|
|
|
|
PORT: 54916
|
|
|
|
MASTER_IP: 127.0.0.1
|
|
|
|
MASTER_PORT: 54915
|
|
|
|
PASSPHRASE: passw0rd
|
|
|
|
CALLSIGN: ECHO
|
|
|
|
RADIO_ID: 1000001
|
|
|
|
RX_FREQ: 449000000
|
|
|
|
TX_FREQ: 444000000
|
|
|
|
TX_POWER: 25
|
|
|
|
COLORCODE: 1
|
|
|
|
SLOTS: 1
|
|
|
|
LATITUDE: 00.0000
|
|
|
|
LONGITUDE: 000.0000
|
2021-05-31 18:48:05 -04:00
|
|
|
HEIGHT: 0
|
|
|
|
LOCATION: Earth
|
2021-05-28 19:27:44 -04:00
|
|
|
DESCRIPTION: ECHO
|
2021-05-31 18:48:05 -04:00
|
|
|
URL: www.freedmr.uk
|
2021-05-28 19:27:44 -04:00
|
|
|
SOFTWARE_ID: 20170620
|
|
|
|
PACKAGE_ID: MMDVM_FreeDMR
|
|
|
|
GROUP_HANGTIME: 5
|
|
|
|
OPTIONS:
|
|
|
|
USE_ACL: True
|
|
|
|
SUB_ACL: DENY:1
|
|
|
|
TGID_TS1_ACL: PERMIT:ALL
|
|
|
|
TGID_TS2_ACL: PERMIT:ALL
|
|
|
|
ANNOUNCEMENT_LANGUAGE: en_GB_2
|
|
|
|
EOF
|
|
|
|
|
|
|
|
echo Install rules.py ...
|
|
|
|
echo "BRIDGES = {'9990': [{'SYSTEM': 'ECHO', 'TS': 2, 'TGID': 9990, 'ACTIVE': True, 'TIMEOUT': 2, 'TO_TYPE': 'NONE', 'ON': [], 'OFF': [], 'RESET': []},]}" > /etc/freedmr/rules.py &&
|
|
|
|
|
|
|
|
echo Set perms on config directory...
|
|
|
|
chown -R 54000 /etc/freedmr &&
|
|
|
|
|
|
|
|
echo Setup logging...
|
|
|
|
mkdir -p /var/log/freedmr &&
|
|
|
|
touch /var/log/freedmr/freedmr.log &&
|
|
|
|
chown -R 54000 /var/log/freedmr &&
|
|
|
|
|
|
|
|
echo Run FreeDMR container...
|
|
|
|
docker run --name=freedmr -d --read-only -v /etc/freedmr/freedmr.cfg:/opt/freedmr/freedmr.cfg \
|
|
|
|
-v /var/log/freedmr/freedmr.log:/opt/freedmr/freedmr.log \
|
|
|
|
-v /etc/freedmr/rules.py:/opt/freedmr/rules.py -p 62031:62031/udp -p 62036-62046:62036-62046/udp \
|
2021-05-31 12:54:29 -04:00
|
|
|
-p 4321:4321/tcp hacknix/freedmr:latest &&
|
2021-05-28 19:27:44 -04:00
|
|
|
|
|
|
|
echo Set to restart on boot and when it dies...
|
2021-05-31 12:54:29 -04:00
|
|
|
docker update --restart unless-stopped freedmr &&
|
|
|
|
|
|
|
|
echo Download update script for future use...
|
|
|
|
curl https://raw.githubusercontent.com/hacknix/FreeDMR/master/docker-configs/update_freedmr.sh -o update_freedmr.sh &&
|
|
|
|
chmod 700 ./update_freedmr.sh
|
2021-05-28 19:27:44 -04:00
|
|
|
|
|
|
|
echo FreeDMR setup complete!
|
|
|
|
|
|
|
|
|