forked from adamfast/DMRlink
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mk_dmrlink
executable file
·117 lines (98 loc) · 4.25 KB
/
mk_dmrlink
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
#! /bin/sh
#################################################
# #
# Create directory structure for DMRlink #
# #
#################################################
apt-get install unzip -y
apt-get install python-twisted -y
# To allow multiple instances of DMRlink to run
# You need multiple ipsc directories, dmrlink.py and dmrlink.cfg
# The needed files are copied to /opt/dmrlink
# Make needed directories
mkdir -p /opt/dmrlink/ambe_audio/ipsc
mkdir -p /opt/dmrlink/bridge/ipsc
mkdir -p /opt/dmrlink/gateway/ipsc
mkdir -p /opt/dmrlink/log/ipsc
mkdir -p /opt/dmrlink/playback/ipsc
mkdir -p /opt/dmrlink/play_group/ipsc
mkdir -p /opt/dmrlink/record/ipsc
mkdir -p /opt/dmrlink/rcm/ipsc
mkdir -p /opt/dmrlink/doc
mkdir -p /opt/dmrlink/samples
mkdir -p /var/log/dmrlink
# Put scripts in /opt/dmrlink
cp /srv/DMRlink/get_ids.sh /opt/dmrlink # should be linked to /etc/cron.daily
cp /srv/DMRlink/init.d/bridge /opt/dmrlink/rc.bridge
# bitstring install
cd /opt/dmrlink
wget https://pypi.python.org/packages/source/b/bitstring/bitstring-3.1.3.zip
unzip bitstring-3.1.3.zip
cd bitstring-3.1.3
python setup.py install
cd /opt/dmrlink
rm bitstring-3.1.3.zip
# Put common files in /opt/dmrlink
cp /srv/DMRlink/subscriber_ids.csv /opt/dmrlink
cp /srv/DMRlink/talkgroup_ids.csv /opt/dmrlink
cp /srv/DMRlink/peer_ids.csv /opt/dmrlink
cp /srv/DMRlink/get_ids.sh /opt/dmrlink
# Copy ipsc directory into each app directory
cp /srv/DMRlink/ipsc/* /opt/dmrlink/ambe_audio/ipsc
cp /srv/DMRlink/ipsc/* /opt/dmrlink/bridge/ipsc
cp /srv/DMRlink/ipsc/* /opt/dmrlink/gateway/ipsc
cp /srv/DMRlink/ipsc/* /opt/dmrlink/log/ipsc
cp /srv/DMRlink/ipsc/* /opt/dmrlink/playback/ipsc
cp /srv/DMRlink/ipsc/* /opt/dmrlink/play_group/ipsc
cp /srv/DMRlink/ipsc/* /opt/dmrlink/record/ipsc
cp /srv/DMRlink/ipsc/* /opt/dmrlink/rcm/ipsc
# Put the samples together for easy ref
cp /srv/DMRlink/bridge_rules_SAMPLE.py /opt/dmrlink/samples
cp /srv/DMRlink/dmrlink_SAMPLE.cfg /opt/dmrlink/samples
cp /srv/DMRlink/known_bridges_SAMPLE.py /opt/dmrlink/samples
cp /srv/DMRlink/playback_config_SAMPLE.py /opt/dmrlink/samples
# Put the doc together for easy ref
cp /srv/DMRlink/FAQ.md /opt/dmrlink/doc
cp /srv/DMRlink/internal_data_decode.txt /opt/dmrlink/doc
cp /srv/DMRlink/LICENSE.txt /opt/dmrlink/doc
cp /srv/DMRlink/README.md /opt/dmrlink/doc
cp /srv/DMRlink/requirements.txt /opt/dmrlink/doc
# Stock ambe_audio
cp /srv/DMRlink/ambe_audio.cfg /opt/dmrlink/ambe_audio/
cp /srv/DMRlink/ambe_audio.py /opt/dmrlink/ambe_audio/
cp /srv/DMRlink/dmrlink.py /opt/dmrlink/ambe_audio/
cp /srv/DMRlink/dmrlink_SAMPLE.cfg /opt/dmrlink/ambe_audio/dmrlink.cfg
# ambe_audio for DMRGateway
cp /srv/DMRlink/ambe_audio.cfg /opt/dmrlink/gateway/
cp /srv/DMRlink/ambe_audio.py /opt/dmrlink/gateway/
cp /srv/DMRlink/dmrlink.py /opt/dmrlink/gateway/
cp /srv/DMRlink/dmrlink_SAMPLE.cfg /opt/dmrlink/gateway/dmrlink.cfg
# Bridge app
cp /srv/DMRlink/bridge.py /opt/dmrlink/bridge/
cp /srv/DMRlink/dmrlink.py /opt/dmrlink/bridge/
cp /srv/DMRlink/bridge_rules_SAMPLE.py /opt/dmrlink/bridge/
cp /srv/DMRlink/dmrlink_SAMPLE.cfg /opt/dmrlink/bridge/dmrlink.cfg
cp /srv/DMRlink/known_bridges_SAMPLE.py /opt/dmrlink/bridge/known_bridges.py
# Log app
cp /srv/DMRlink/log.py /opt/dmrlink/log/
cp /srv/DMRlink/dmrlink.py /opt/dmrlink/log/
cp /srv/DMRlink/dmrlink_SAMPLE.cfg /opt/dmrlink/log/dmrlink.cfg
# Playback (Parrot)
cp /srv/DMRlink/playback.py /opt/dmrlink/playback/
cp /srv/DMRlink/dmrlink.py /opt/dmrlink/playback/
cp /srv/DMRlink/dmrlink_SAMPLE.cfg /opt/dmrlink/playback/dmrlink.cfg
cp /srv/DMRlink/playback_config_SAMPLE.py /opt/dmrlink/playback/playback_config_SAMPLE.py
# Play Group app
cp /srv/DMRlink/play_group.py /opt/dmrlink/play_group/
cp /srv/DMRlink/dmrlink.py /opt/dmrlink/play_group/
cp /srv/DMRlink/dmrlink_SAMPLE.cfg /opt/dmrlink/play_group/dmrlink.cfg
# record app
cp /srv/DMRlink/record.py /opt/dmrlink/record/
cp /srv/DMRlink/dmrlink.py /opt/dmrlink/record/
cp /srv/DMRlink/dmrlink_SAMPLE.cfg /opt/dmrlink/record/dmrlink.cfg
# rcm app
cp /srv/DMRlink/rcm_db_log.py /opt/dmrlink/rcm/
cp /srv/DMRlink/rcm.py /opt/dmrlink/rcm/
cp /srv/DMRlink/dmrlink.py /opt/dmrlink/rcm/
cp /srv/DMRlink/dmrlink_SAMPLE.cfg /opt/dmrlink/rcm/dmrlink.cfg
cp /srv/DMRlink/pickle_stat_reader.py /opt/dmrlink/rcm/