126 lines
4.5 KiB
Bash
Executable File
126 lines
4.5 KiB
Bash
Executable File
#! /bin/bash
|
|
|
|
#################################################
|
|
# #
|
|
# Create directory structure for DMRlink #
|
|
# #
|
|
#################################################
|
|
|
|
if [ ! -f /opt/dmrlink/get_ids.sh ]; then
|
|
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
|
|
|
|
# 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
|
|
cp /srv/DMRlink/RS129.py /opt/dmrlink
|
|
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
|
|
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
|
|
cp /srv/DMRlink/internal_data_decode.txt /opt/dmrlink/doc
|
|
cp /srv/DMRlink/voice_burst_decoding.txt /opt/dmrlink/doc
|
|
cp /srv/DMRlink/voice_packets.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/ambe_audio/
|
|
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/
|
|
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/
|
|
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/
|
|
|