DMRlink/mk_dmrlink
2016-08-17 08:32:06 -04:00

115 lines
4.1 KiB
Bash
Executable File

#! /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/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/f3/e5/dfe4c49c93d174a5fd807ed307d3a3f38c6b3e140972945f81a5f5578ca7/bitstring-3.1.5.zip
unzip bitstring-3.1.5.zip
cd bitstring-3.1.5
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/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
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
cp /srv/DMRlink/ambe_audio_commands.txt /opt/dmrlink/doc
# 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/
cp /srv/DMRlink/template.bin /opt/dmrlink/ambe_audio/
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/
cp /srv/DMRlink/dmrlink_SAMPLE.cfg /opt/dmrlink/bridge/
cp /srv/DMRlink/known_bridges_SAMPLE.py /opt/dmrlink/bridge/
# 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/
# 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/
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/
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/
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/
cp /srv/DMRlink/dmrlink_SAMPLE.cfg /opt/dmrlink/rcm/
cp /srv/DMRlink/pickle_stat_reader.py /opt/dmrlink/rcm/