forked from adamfast/DMRlink
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmk-dmrlink
executable file
·162 lines (140 loc) · 5.94 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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
#! /bin/bash
#################################################
# #
# Install DMRlink in seperate directories by #
# Application #
#################################################
# Install the required support programs
apt-get install unzip -y
apt-get install python-dev -y
apt-get install python-pip -y
apt-get install python-twisted -y
pip install bitstring
pip install bitarray
cd /opt
git clone https://github.com/n0mjs710/dmr_utils.git
cd dmr_utils/
pip install .
echo "Required programs installed, continuing"
# 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
# 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
# Make needed directories
mkdir -p /opt/dmrlink/ambe_audio/
mkdir -p /opt/dmrlink/bridge/
mkdir -p /opt/dmrlink/confbridge/
mkdir -p /opt/dmrlink/log/
mkdir -p /opt/dmrlink/playback/
mkdir -p /opt/dmrlink/play_group/
mkdir -p /opt/dmrlink/record/
mkdir -p /opt/dmrlink/rcm/
mkdir -p /opt/dmrlink/samples
mkdir -p /var/log/dmrlink
cd /opt/dmrlink
# Put common files in /opt/dmrlink
cp /srv/DMRlink/get_ids.sh /opt/dmrlink
cp /srv/DMRlink/peer_ids.csv /opt/dmrlink
cp /srv/DMRlink/subscriber_ids.csv /opt/dmrlink
cp /srv/DMRlink/talkgroup_ids.csv /opt/dmrlink
# Copy ipsc directory into each app directory
cp -rf /srv/DMRlink/ipsc/ /opt/dmrlink/ambe_audio/
cp -rf /srv/DMRlink/ipsc/ /opt/dmrlink/bridge/
cp -rf /srv/DMRlink/ipsc/ /opt/dmrlink/confbridge/
cp -rf /srv/DMRlink/ipsc/ /opt/dmrlink/log/
cp -rf /srv/DMRlink/ipsc/ /opt/dmrlink/playback/
cp -rf /srv/DMRlink/ipsc/ /opt/dmrlink/play_group/
cp -rf /srv/DMRlink/ipsc/ /opt/dmrlink/record/
cp -rf /srv/DMRlink/ipsc/ /opt/dmrlink/rcm/
# Put a copy of the samples together for easy reference
cp /srv/DMRlink/bridge_rules_SAMPLE.py /opt/dmrlink/samples
cp /srv/DMRlink/confbridge_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
cp /srv/DMRlink/ambe_audio.cfg /opt/dmrlink/samples
cp /srv/DMRlink/sub_acl_SAMPLE.py /opt/dmrlink/samples
# Put the doc together for easy reference
cp -rf /srv/DMRlink/documents /opt/dmrlink
cp /srv/DMRlink/LICENSE.txt /opt/dmrlink/documents
cp /srv/DMRlink/requirements.txt /opt/dmrlink/documents
cp /srv/DMRlink/ambe_audio_commands.txt /opt/dmrlink/documents
# ambe_audio
cp /srv/DMRlink/dmrlink.py /opt/dmrlink/ambe_audio/
cp /srv/DMRlink/dmrlink_config.py /opt/dmrlink/ambe_audio/
cp /srv/DMRlink/dmrlink_log.py /opt/dmrlink/ambe_audio/
cp /srv/DMRlink/template.py /opt/dmrlink/ambe_audio/
cp /srv/DMRlink/dmrlink_SAMPLE.cfg /opt/dmrlink/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/ambe_audio_commands.txt /opt/dmrlink/ambe_audio/
cp /srv/DMRlink/template.bin /opt/dmrlink/ambe_audio/
# Bridge app
cp /srv/DMRlink/dmrlink.py /opt/dmrlink/bridge/
cp /srv/DMRlink/dmrlink_config.py /opt/dmrlink/bridge/
cp /srv/DMRlink/dmrlink_log.py /opt/dmrlink/bridge/
cp /srv/DMRlink/template.py /opt/dmrlink/bridge/
cp /srv/DMRlink/dmrlink_SAMPLE.cfg /opt/dmrlink/bridge/
#
cp /srv/DMRlink/bridge.py /opt/dmrlink/bridge/
cp /srv/DMRlink/bridge_rules_SAMPLE.py /opt/dmrlink/bridge/
cp /srv/DMRlink/known_bridges_SAMPLE.py /opt/dmrlink/bridge/
cp /srv/DMRlink/sub_acl_SAMPLE.py /opt/dmrlink/bridge/
# ConfBridge app
cp /srv/DMRlink/dmrlink.py /opt/dmrlink/confbridge/
cp /srv/DMRlink/dmrlink_config.py /opt/dmrlink/confbridge/
cp /srv/DMRlink/dmrlink_log.py /opt/dmrlink/confbridge/
cp /srv/DMRlink/template.py /opt/dmrlink/confbridge/
cp /srv/DMRlink/dmrlink_SAMPLE.cfg /opt/dmrlink/confbridge/
#
cp /srv/DMRlink/confbridge.py /opt/dmrlink/confbridge/
cp /srv/DMRlink/confbridge_rules_SAMPLE.py /opt/dmrlink/confbridge/
# Need these?
cp /srv/DMRlink/known_bridges_SAMPLE.py /opt/dmrlink/confbridge/
cp /srv/DMRlink/sub_acl_SAMPLE.py /opt/dmrlink/confbridge/
# Log app
cp /srv/DMRlink/dmrlink.py /opt/dmrlink/log/
cp /srv/DMRlink/dmrlink_config.py /opt/dmrlink/log/
cp /srv/DMRlink/dmrlink_log.py /opt/dmrlink/log/
cp /srv/DMRlink/template.py /opt/dmrlink/log/
cp /srv/DMRlink/dmrlink_SAMPLE.cfg /opt/dmrlink/log/
#
cp /srv/DMRlink/log.py /opt/dmrlink/log/
# Playback (Parrot)
cp /srv/DMRlink/dmrlink.py /opt/dmrlink/playback/
cp /srv/DMRlink/dmrlink_config.py /opt/dmrlink/playback/
cp /srv/DMRlink/dmrlink_log.py /opt/dmrlink/playback/
cp /srv/DMRlink/template.py /opt/dmrlink/playback/
cp /srv/DMRlink/dmrlink_SAMPLE.cfg /opt/dmrlink/playback/
#
cp /srv/DMRlink/playback.py /opt/dmrlink/playback/
cp /srv/DMRlink/playback_config_SAMPLE.py /opt/dmrlink/playback/
# Play Group app
cp /srv/DMRlink/dmrlink.py /opt/dmrlink/play_group/
cp /srv/DMRlink/dmrlink_config.py /opt/dmrlink/play_group/
cp /srv/DMRlink/dmrlink_log.py /opt/dmrlink/play_group/
cp /srv/DMRlink/template.py /opt/dmrlink/play_group/
cp /srv/DMRlink/dmrlink_SAMPLE.cfg /opt/dmrlink/play_group/
#
cp /srv/DMRlink/play_group.py /opt/dmrlink/play_group/
# record app
cp /srv/DMRlink/dmrlink.py /opt/dmrlink/record/
cp /srv/DMRlink/dmrlink_config.py /opt/dmrlink/record/
cp /srv/DMRlink/dmrlink_log.py /opt/dmrlink/record/
cp /srv/DMRlink/template.py /opt/dmrlink/record/
cp /srv/DMRlink/dmrlink_SAMPLE.cfg /opt/dmrlink/record/
#
cp /srv/DMRlink/record.py /opt/dmrlink/record/
# rcm app
cp /srv/DMRlink/dmrlink.py /opt/dmrlink/rcm/
cp /srv/DMRlink/dmrlink_config.py /opt/dmrlink/rcm/
cp /srv/DMRlink/dmrlink_log.py /opt/dmrlink/rcm/
cp /srv/DMRlink/template.py /opt/dmrlink/rcm/
cp /srv/DMRlink/dmrlink_SAMPLE.cfg /opt/dmrlink/rcm/
#
cp /srv/DMRlink/rcm_db_log.py /opt/dmrlink/rcm/
cp /srv/DMRlink/rcm.py /opt/dmrlink/rcm/
cp /srv/DMRlink/pickle_stat_reader.py /opt/dmrlink/rcm/