DMRlink/mk-dmrlink
2017-06-20 08:46:58 -04:00

147 lines
4.8 KiB
Bash
Executable File

#! /bin/bash
currentdir=`pwd`
echo "Current working directory is" $currentdir
echo ""
#################################################
# #
# 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
# Make needed directories
mkdir -p /opt/dmrlink/IPSC_Bridge/
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/proxy/
mkdir -p /opt/dmrlink/rcm/
mkdir -p /opt/dmrlink/record/
mkdir -p /opt/dmrlink/samples
mkdir -p /var/log/dmrlink
cd /opt/dmrlink
# Put common files in /opt/dmrlink
# cp $currentdir/peer_ids.csv /opt/dmrlink
# cp $currentdir/subscriber_ids.csv /opt/dmrlink
# cp $currentdir/talkgroup_ids.csv /opt/dmrlink
# Copy ipsc directory into each app directory
cp -rf $currentdir/ipsc/ /opt/dmrlink/IPSC_Bridge/
cp -rf $currentdir/ipsc/ /opt/dmrlink/bridge/
cp -rf $currentdir/ipsc/ /opt/dmrlink/confbridge/
cp -rf $currentdir/ipsc/ /opt/dmrlink/log/
cp -rf $currentdir/ipsc/ /opt/dmrlink/playback/
cp -rf $currentdir/ipsc/ /opt/dmrlink/play_group/
cp -rf $currentdir/ipsc/ /opt/dmrlink/proxy/
cp -rf $currentdir/ipsc/ /opt/dmrlink/rcm/
cp -rf $currentdir/ipsc/ /opt/dmrlink/record/
# Put a copy of the samples together for easy reference
cp $currentdir/bridge_rules_SAMPLE.py /opt/dmrlink/samples
cp $currentdir/confbridge_rules_SAMPLE.py /opt/dmrlink/samples
cp $currentdir/dmrlink_SAMPLE.cfg /opt/dmrlink/samples
cp $currentdir/known_bridges_SAMPLE.py /opt/dmrlink/samples
cp $currentdir/playback_config_SAMPLE.py /opt/dmrlink/samples
cp $currentdir/IPSC_Bridge.cfg /opt/dmrlink/samples
cp $currentdir/sub_acl_SAMPLE.py /opt/dmrlink/samples
# Put the doc together for easy reference
cp -rf $currentdir/documents /opt/dmrlink
cp $currentdir/LICENSE.txt /opt/dmrlink/documents
cp $currentdir/requirements.txt /opt/dmrlink/documents
# cp $currentdir/IPSC_Bridge_commands.txt /opt/dmrlink/documents
# IPSC_Bridge
cp $currentdir/dmrlink.py /opt/dmrlink/IPSC_Bridge/
cp $currentdir/dmrlink_SAMPLE.cfg /opt/dmrlink/IPSC_Bridge/
#
cp $currentdir/IPSC_Bridge.cfg /opt/dmrlink/IPSC_Bridge/
cp $currentdir/IPSC_Bridge.py /opt/dmrlink/IPSC_Bridge/
# cp $currentdir/IPSC_Bridge_commands.txt /opt/dmrlink/IPSC_Bridge/
# cp $currentdir/template.bin /opt/dmrlink/IPSC_Bridge/
# Bridge app
cp $currentdir/dmrlink.py /opt/dmrlink/bridge/
cp $currentdir/dmrlink_SAMPLE.cfg /opt/dmrlink/bridge/
#
cp $currentdir/bridge.py /opt/dmrlink/bridge/
cp $currentdir/bridge_rules_SAMPLE.py /opt/dmrlink/bridge/
cp $currentdir/known_bridges_SAMPLE.py /opt/dmrlink/bridge/
cp $currentdir/sub_acl_SAMPLE.py /opt/dmrlink/bridge/
# ConfBridge app
cp $currentdir/dmrlink.py /opt/dmrlink/confbridge/
cp $currentdir/dmrlink_SAMPLE.cfg /opt/dmrlink/confbridge/
#
cp $currentdir/confbridge.py /opt/dmrlink/confbridge/
cp $currentdir/confbridge_rules_SAMPLE.py /opt/dmrlink/confbridge/
cp $currentdir/known_bridges_SAMPLE.py /opt/dmrlink/confbridge/
cp $currentdir/sub_acl_SAMPLE.py /opt/dmrlink/confbridge/
# Log app
cp $currentdir/dmrlink.py /opt/dmrlink/log/
cp $currentdir/dmrlink_SAMPLE.cfg /opt/dmrlink/log/
#
cp $currentdir/log.py /opt/dmrlink/log/
# Playback (Parrot)
cp $currentdir/dmrlink.py /opt/dmrlink/playback/
cp $currentdir/dmrlink_SAMPLE.cfg /opt/dmrlink/playback/
#
cp $currentdir/playback.py /opt/dmrlink/playback/
cp $currentdir/playback_config_SAMPLE.py /opt/dmrlink/playback/
# Play Group app
cp $currentdir/dmrlink.py /opt/dmrlink/play_group/
cp $currentdir/dmrlink_SAMPLE.cfg /opt/dmrlink/play_group/
#
cp $currentdir/play_group.py /opt/dmrlink/play_group/
# proxy app
cp $currentdir/dmrlink.py /opt/dmrlink/proxy/
cp $currentdir/dmrlink_SAMPLE.cfg /opt/dmrlink/proxy/
#
cp $currentdir/proxy.py /opt/dmrlink/proxy/
cp $currentdir/known_bridges_SAMPLE.py /opt/dmrlink/proxy/
cp $currentdir/sub_acl_SAMPLE.py /opt/dmrlink/proxy/
# rcm app
cp $currentdir/dmrlink.py /opt/dmrlink/rcm/
cp $currentdir/dmrlink_SAMPLE.cfg /opt/dmrlink/rcm/
#
cp $currentdir/rcm_db_log.py /opt/dmrlink/rcm/
cp $currentdir/rcm.py /opt/dmrlink/rcm/
# record app
cp $currentdir/dmrlink.py /opt/dmrlink/record/
cp $currentdir/dmrlink_SAMPLE.cfg /opt/dmrlink/record/
#
cp $currentdir/record.py /opt/dmrlink/record/