DMRlink/mk-dmrlink

164 lines
5.3 KiB
Plaintext
Raw Permalink Normal View History

2017-01-30 15:20:51 -05:00
#! /bin/bash
PREFIX=/opt/dmrlink
echo "DMRlink will be installed in: $PREFIX"
currentdir=`pwd`
echo "Current working directory is: $currentdir"
echo ""
2017-01-30 15:20:51 -05:00
#################################################
# #
# Install DMRlink in seperate directories by #
# Application #
#################################################
2017-01-30 15:24:36 -05:00
# Install the required support programs
distro=$(lsb_release -i | awk -F":" '{ gsub(/^[ \t]+/, "", $2); print $2 }')
release=$(lsb_release -r | awk -F":" '{ gsub(/^[ \t]+/, "", $2); print $2 }')
echo "Current Linux distribution is: $distro $release"
if [[ "$distro" =~ ^(CentOS|Fedora|openSUSE|)$ ]]; then
echo "$distro uses yum"
yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-$(echo $release | awk -F"." '{print $1}').noarch.rpm
yum install -y gcc gcc-c++ glibc-devel make
yum install -y unzip
yum install -y python-devel
yum install -y python-pip
yum install -y python-twisted
# pip install bitstring
# pip install bitarray
else
echo "$distro uses apt"
apt-get install -y build-essential
apt-get install -y unzip
apt-get install -y python-dev
apt-get install -y python-pip
apt-get install -y python-twisted
# pip install bitstring
# pip install bitarray
fi
# Install dmr_utils with pip install
pip install dmr_utils
###############################################################################
# Following lines should be removed due to the pip install method for dmr_utils
#cd /opt
#if [ ! -d /opt/dmr_utils ]; then
# git clone https://github.com/n0mjs710/dmr_utils.git
#fi
#cd dmr_utils/
#git pull
#pip install .
###############################################################################
2017-01-30 15:20:51 -05:00
2017-01-30 15:24:36 -05:00
echo "Required programs installed, continuing"
2017-01-30 15:20:51 -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
mkdir -p $PREFIX/confbridge/
mkdir -p $PREFIX/playback/
mkdir -p $PREFIX/proxy/
mkdir -p $PREFIX/samples
mkdir -p /var/log/dmrlink
cd $PREFIX
2017-01-30 15:20:51 -05:00
# 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
2017-01-30 15:20:51 -05:00
# Copy ipsc directory into each app directory
cp -rf $currentdir/ipsc/ $PREFIX/confbridge/
cp -rf $currentdir/ipsc/ $PREFIX/playback/
cp -rf $currentdir/ipsc/ $PREFIX/proxy/
2017-01-30 15:20:51 -05:00
# 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 $PREFIX/samples
cp $currentdir/dmrlink_SAMPLE.cfg $PREFIX/samples
#cp $currentdir/known_bridges_SAMPLE.py /opt/dmrlink/samples
cp $currentdir/playback_config_SAMPLE.py $PREFIX/samples
#cp $currentdir/ambe_audio.cfg /opt/dmrlink/samples
cp $currentdir/sub_acl_SAMPLE.py /opt/dmrlink/samples
2017-01-30 15:20:51 -05:00
# Put the doc together for easy reference
cp -rf $currentdir/documents $PREFIX
cp $currentdir/LICENSE.txt $PREFIX/documents
cp $currentdir/requirements.txt $PREFIX/documents
#cp $currentdir/ambe_audio_commands.txt /opt/dmrlink/documents
2017-01-30 15:20:51 -05:00
# ambe_audio
#cp $currentdir/dmrlink.py /opt/dmrlink/ambe_audio/
#cp $currentdir/dmrlink_SAMPLE.cfg /opt/dmrlink/ambe_audio/
2017-01-30 15:20:51 -05:00
#
#cp $currentdir/ambe_audio.cfg /opt/dmrlink/ambe_audio/
#cp $currentdir/ambe_audio.py /opt/dmrlink/ambe_audio/
#cp $currentdir/ambe_audio_commands.txt /opt/dmrlink/ambe_audio/
#cp $currentdir/template.bin /opt/dmrlink/ambe_audio/
2017-01-30 15:20:51 -05:00
# Bridge app
#cp $currentdir/dmrlink.py /opt/dmrlink/bridge/
#cp $currentdir/dmrlink_SAMPLE.cfg /opt/dmrlink/bridge/
2017-01-30 15:20:51 -05:00
#
#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/
2017-01-30 15:20:51 -05:00
# ConfBridge app
cp $currentdir/dmrlink.py $PREFIX/confbridge/
cp $currentdir/dmrlink_SAMPLE.cfg $PREFIX/confbridge/
2017-01-30 15:20:51 -05:00
#
cp $currentdir/confbridge.py $PREFIX/confbridge/
cp $currentdir/confbridge_rules_SAMPLE.py $PREFIX/confbridge/
#cp $currentdir/known_bridges_SAMPLE.py /opt/dmrlink/confbridge/
cp $currentdir/sub_acl_SAMPLE.py $PREFIX/confbridge/
2017-01-30 15:20:51 -05:00
# Log app
#cp $currentdir/dmrlink.py /opt/dmrlink/log/
#cp $currentdir/dmrlink_SAMPLE.cfg /opt/dmrlink/log/
2017-01-30 15:20:51 -05:00
#
#cp $currentdir/log.py /opt/dmrlink/log/
2017-01-30 15:20:51 -05:00
# Playback (Parrot)
cp $currentdir/dmrlink.py $PREFIX/playback/
cp $currentdir/dmrlink_SAMPLE.cfg $PREFIX/playback/
2017-01-30 15:20:51 -05:00
#
cp $currentdir/playback.py $PREFIX/playback/
cp $currentdir/playback_config_SAMPLE.py $PREFIX/playback/
2017-01-30 15:20:51 -05:00
# Play Group app
#cp $currentdir/dmrlink.py /opt/dmrlink/play_group/
#cp $currentdir/dmrlink_SAMPLE.cfg /opt/dmrlink/play_group/
2017-01-30 15:20:51 -05:00
#
#cp $currentdir/play_group.py /opt/dmrlink/play_group/
2017-01-30 15:20:51 -05:00
# proxy app
cp $currentdir/dmrlink.py $PREFIX/proxy/
cp $currentdir/dmrlink_SAMPLE.cfg $PREFIX/proxy/
2017-01-30 15:20:51 -05:00
#
cp $currentdir/proxy.py $PREFIX/proxy/
#cp $currentdir/known_bridges_SAMPLE.py $PREFIX/proxy/
cp $currentdir/sub_acl_SAMPLE.py $PREFIX/proxy/
2017-01-30 15:20:51 -05:00
# rcm app
#cp $currentdir/dmrlink.py /opt/dmrlink/rcm/
#cp $currentdir/dmrlink_SAMPLE.cfg /opt/dmrlink/rcm/
2017-01-30 15:20:51 -05:00
#
#cp $currentdir/rcm_db_log.py /opt/dmrlink/rcm/
#cp $currentdir/rcm.py /opt/dmrlink/rcm/
2017-01-30 15:20:51 -05:00
# record app
#cp $currentdir/dmrlink.py /opt/dmrlink/record/
#cp $currentdir/dmrlink_SAMPLE.cfg /opt/dmrlink/record/
#
#cp $currentdir/record.py /opt/dmrlink/record/
2017-01-05 15:01:32 -05:00