#!/bin/bash

echo "This utility upgrades to Asterisk 18 current release"
read -p "Press Enter to proceed at your own risk or Ctrl-C to abort..."
cd /usr/src
rm -rf asterisk-18*
wget http://downloads.asterisk.org/pub/telephony/asterisk/old-releases/asterisk-18.7.0.tar.gz
#wget https://downloads.asterisk.org/pub/telephony/asterisk/asterisk-18-current.tar.gz
tar zxvf asterisk-18*
rm -f asterisk-18*.tar.gz
cd asterisk-18*
contrib/scripts/get_mp3_source.sh
contrib/scripts/install_prereq install
make distclean
tar zxvf /root/menuselect-incredible17*.tar.gz
./configure --with-pjproject-bundled --with-jansson-bundled
make menuselect.makeopts
menuselect/menuselect --disable-category MENUSELECT_TESTS menuselect.makeopts
make menuselect
read -p "Press Enter to proceed at your own risk or Ctrl-C to abort..."
make && make install && ldconfig
touch /etc/asterisk/stir_shaken.conf
fwconsole restart
