Skip to content

Instantly share code, notes, and snippets.

@dmitriysafronov
Last active October 24, 2016 10:33
Show Gist options
  • Save dmitriysafronov/5793b3dc3bde8e08d6cd80d2eca92a53 to your computer and use it in GitHub Desktop.
Save dmitriysafronov/5793b3dc3bde8e08d6cd80d2eca92a53 to your computer and use it in GitHub Desktop.
#!/bin/bash
if [[ -n "$(which apt)" ]]; then
apt install -y wget unzip automake autoconf gcc make asterisk-dev
DESTDIR=/usr/lib/asterisk/modules
LDFLAGS="-z muldefs"
elif [[ -n "$(which yum)" ]]; then
yum install -y wget unzip automake autoconf gcc make asterisk-devel
DESTDIR=/usr/lib64/asterisk/modules
LDFLAGS=""
else
echo "No appropriate package manager!"
exit 1
fi
export DESTDIR
export LDFLAGS
########
OLD_PWD="${PWD}"
########
cd /usr/src
wget https://github.com/oleg-krv/asterisk-chan-dongle/archive/asterisk13.zip
unzip -o asterisk13.zip
rm -f asterisk13.zip
cd asterisk-chan-dongle-asterisk13
aclocal && autoconf && automake -a
./configure
make
make install
########
cp -f --remove-destination etc/dongle.conf /root/dongle.conf
cp -f --remove-destination etc/extensions.conf /root/dongle-extensions.conf
########
cd "${OLD_PWD}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment