2017-01-30 15:20:51 -05:00
|
|
|
#! /bin/bash
|
|
|
|
|
2019-04-14 19:39:23 -04:00
|
|
|
PREFIX=/opt/dmrlink
|
|
|
|
echo "DMRlink will be installed in: $PREFIX"
|
2017-05-29 07:56:32 -04:00
|
|
|
|
2019-04-14 19:39:23 -04:00
|
|
|
currentdir=`pwd`
|
|
|
|
echo "Current working directory is: $currentdir"
|
2017-05-29 07:56:32 -04:00
|
|
|
|
|
|
|
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
|
2019-04-14 19:39:23 -04:00
|
|
|
|
|
|
|
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
|
2019-04-14 19:39:23 -04:00
|
|
|
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
|
2017-05-29 07:56:32 -04:00
|
|
|
# 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
|
2019-04-14 19:39:23 -04:00
|
|
|
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
|
2017-08-25 15:27:53 -04:00
|
|
|
#cp $currentdir/bridge_rules_SAMPLE.py /opt/dmrlink/samples
|
2019-04-14 19:39:23 -04:00
|
|
|
cp $currentdir/confbridge_rules_SAMPLE.py $PREFIX/samples
|
|
|
|
cp $currentdir/dmrlink_SAMPLE.cfg $PREFIX/samples
|
2019-04-14 13:35:58 -04:00
|
|
|
#cp $currentdir/known_bridges_SAMPLE.py /opt/dmrlink/samples
|
2019-04-14 19:39:23 -04:00
|
|
|
cp $currentdir/playback_config_SAMPLE.py $PREFIX/samples
|
2017-08-25 15:27:53 -04:00
|
|
|
#cp $currentdir/ambe_audio.cfg /opt/dmrlink/samples
|
2017-05-29 07:56:32 -04:00
|
|
|
cp $currentdir/sub_acl_SAMPLE.py /opt/dmrlink/samples
|
2017-01-30 15:20:51 -05:00
|
|
|
|
|
|
|
# Put the doc together for easy reference
|
2019-04-14 19:39:23 -04:00
|
|
|
cp -rf $currentdir/documents $PREFIX
|
|
|
|
cp $currentdir/LICENSE.txt $PREFIX/documents
|
|
|
|
cp $currentdir/requirements.txt $PREFIX/documents
|
2017-08-25 15:27:53 -04:00
|
|
|
#cp $currentdir/ambe_audio_commands.txt /opt/dmrlink/documents
|
2017-01-30 15:20:51 -05:00
|
|
|
|
|
|
|
# ambe_audio
|
2017-08-25 15:27:53 -04:00
|
|
|
#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
|
|
|
#
|
2017-08-25 15:27:53 -04: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
|
2017-08-25 15:27:53 -04:00
|
|
|
#cp $currentdir/dmrlink.py /opt/dmrlink/bridge/
|
|
|
|
#cp $currentdir/dmrlink_SAMPLE.cfg /opt/dmrlink/bridge/
|
2017-01-30 15:20:51 -05:00
|
|
|
#
|
2017-08-25 15:27:53 -04: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
|
2019-04-14 19:39:23 -04:00
|
|
|
cp $currentdir/dmrlink.py $PREFIX/confbridge/
|
|
|
|
cp $currentdir/dmrlink_SAMPLE.cfg $PREFIX/confbridge/
|
2017-01-30 15:20:51 -05:00
|
|
|
#
|
2019-04-14 19:39:23 -04:00
|
|
|
cp $currentdir/confbridge.py $PREFIX/confbridge/
|
|
|
|
cp $currentdir/confbridge_rules_SAMPLE.py $PREFIX/confbridge/
|
2019-04-14 13:35:58 -04:00
|
|
|
#cp $currentdir/known_bridges_SAMPLE.py /opt/dmrlink/confbridge/
|
2019-04-14 19:39:23 -04:00
|
|
|
cp $currentdir/sub_acl_SAMPLE.py $PREFIX/confbridge/
|
2017-01-30 15:20:51 -05:00
|
|
|
|
|
|
|
# Log app
|
2017-08-25 15:27:53 -04:00
|
|
|
#cp $currentdir/dmrlink.py /opt/dmrlink/log/
|
|
|
|
#cp $currentdir/dmrlink_SAMPLE.cfg /opt/dmrlink/log/
|
2017-01-30 15:20:51 -05:00
|
|
|
#
|
2017-08-25 15:27:53 -04:00
|
|
|
#cp $currentdir/log.py /opt/dmrlink/log/
|
2017-01-30 15:20:51 -05:00
|
|
|
|
|
|
|
# Playback (Parrot)
|
2019-04-14 19:39:23 -04:00
|
|
|
cp $currentdir/dmrlink.py $PREFIX/playback/
|
|
|
|
cp $currentdir/dmrlink_SAMPLE.cfg $PREFIX/playback/
|
2017-01-30 15:20:51 -05:00
|
|
|
#
|
2019-04-14 19:39:23 -04: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
|
2017-08-25 15:27:53 -04:00
|
|
|
#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
|
|
|
#
|
2017-08-25 15:27:53 -04:00
|
|
|
#cp $currentdir/play_group.py /opt/dmrlink/play_group/
|
2017-01-30 15:20:51 -05:00
|
|
|
|
2017-05-29 07:25:09 -04:00
|
|
|
# proxy app
|
2019-04-14 19:39:23 -04:00
|
|
|
cp $currentdir/dmrlink.py $PREFIX/proxy/
|
|
|
|
cp $currentdir/dmrlink_SAMPLE.cfg $PREFIX/proxy/
|
2017-01-30 15:20:51 -05:00
|
|
|
#
|
2019-04-14 19:39:23 -04: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
|
2017-08-25 15:27:53 -04:00
|
|
|
#cp $currentdir/dmrlink.py /opt/dmrlink/rcm/
|
|
|
|
#cp $currentdir/dmrlink_SAMPLE.cfg /opt/dmrlink/rcm/
|
2017-01-30 15:20:51 -05:00
|
|
|
#
|
2017-08-25 15:27:53 -04: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
|
|
|
|
2017-05-29 07:25:09 -04:00
|
|
|
# record app
|
2017-08-25 15:27:53 -04:00
|
|
|
#cp $currentdir/dmrlink.py /opt/dmrlink/record/
|
|
|
|
#cp $currentdir/dmrlink_SAMPLE.cfg /opt/dmrlink/record/
|
2017-05-29 07:25:09 -04:00
|
|
|
#
|
2017-08-25 15:27:53 -04:00
|
|
|
#cp $currentdir/record.py /opt/dmrlink/record/
|
2017-01-05 15:01:32 -05:00
|
|
|
|