DMRlink/mk_dmrlink

126 lines
4.5 KiB
Plaintext
Raw Normal View History

2016-08-17 09:14:36 -04:00
#! /bin/bash
#################################################
# #
# Create directory structure for DMRlink #
# #
#################################################
2016-08-17 09:14:36 -04:00
if [ ! -f /opt/dmrlink/get_ids.sh ]; then
apt-get install unzip -y
apt-get install python-twisted -y
2015-12-04 06:06:35 -05:00
# 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
2016-08-17 09:14:36 -04:00
mkdir -p /opt/dmrlink/ambe_audio/ipsc
mkdir -p /opt/dmrlink/bridge/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
# bitstring install
cd /opt/dmrlink
wget https://pypi.python.org/packages/f3/e5/dfe4c49c93d174a5fd807ed307d3a3f38c6b3e140972945f81a5f5578ca7/bitstring-3.1.5.zip
unzip bitstring-3.1.5.zip
cd bitstring-3.1.5
python setup.py install
echo "Required programs installed, continuing"
fi
cd /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
# 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
2016-08-17 09:14:36 -04:00
cp /srv/DMRlink/RS129.py /opt/dmrlink
2016-08-17 09:20:32 -04:00
cp /srv/DMRlink/template.py /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/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
2016-08-01 16:06:34 -04:00
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 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
2016-08-01 16:06:34 -04:00
cp /srv/DMRlink/ambe_audio_commands.txt /opt/dmrlink/doc
2016-08-17 09:14:36 -04:00
cp /srv/DMRlink/internal_data_decode.txt /opt/dmrlink/doc
cp /srv/DMRlink/voice_burst_decoding.txt /opt/dmrlink/doc
2016-10-13 14:17:22 -04:00
cp /srv/DMRlink/voice_packets.txt /opt/dmrlink/doc
2016-07-30 21:38:31 -04:00
# 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/
2016-08-31 21:59:01 -04:00
cp /srv/DMRlink/dmrlink_SAMPLE.cfg /opt/dmrlink/ambe_audio/
2016-07-30 21:38:31 -04:00
cp /srv/DMRlink/template.bin /opt/dmrlink/ambe_audio/
2016-08-01 16:06:34 -04:00
cp /srv/DMRlink/ambe_audio_commands.txt /opt/dmrlink/ambe_audio/
# 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/
2016-08-17 08:32:06 -04:00
cp /srv/DMRlink/dmrlink_SAMPLE.cfg /opt/dmrlink/bridge/
cp /srv/DMRlink/known_bridges_SAMPLE.py /opt/dmrlink/bridge/
2016-09-01 05:20:31 -04:00
cp /srv/DMRlink/sub_acl_SAMPLE.py /opt/dmrlink/bridge/
# Log app
cp /srv/DMRlink/log.py /opt/dmrlink/log/
cp /srv/DMRlink/dmrlink.py /opt/dmrlink/log/
2016-08-17 08:32:06 -04:00
cp /srv/DMRlink/dmrlink_SAMPLE.cfg /opt/dmrlink/log/
# Playback (Parrot)
cp /srv/DMRlink/playback.py /opt/dmrlink/playback/
cp /srv/DMRlink/dmrlink.py /opt/dmrlink/playback/
2016-08-17 08:32:06 -04:00
cp /srv/DMRlink/dmrlink_SAMPLE.cfg /opt/dmrlink/playback/
cp /srv/DMRlink/playback_config_SAMPLE.py /opt/dmrlink/playback/
# Play Group app
cp /srv/DMRlink/play_group.py /opt/dmrlink/play_group/
cp /srv/DMRlink/dmrlink.py /opt/dmrlink/play_group/
2016-08-17 08:32:06 -04:00
cp /srv/DMRlink/dmrlink_SAMPLE.cfg /opt/dmrlink/play_group/
# record app
cp /srv/DMRlink/record.py /opt/dmrlink/record/
cp /srv/DMRlink/dmrlink.py /opt/dmrlink/record/
2016-08-17 08:32:06 -04:00
cp /srv/DMRlink/dmrlink_SAMPLE.cfg /opt/dmrlink/record/
# 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/
2016-08-17 08:32:06 -04:00
cp /srv/DMRlink/dmrlink_SAMPLE.cfg /opt/dmrlink/rcm/
cp /srv/DMRlink/pickle_stat_reader.py /opt/dmrlink/rcm/