Asterisk Install Script for Debian by Ulead MediaStudio

Sat, 07 Jun 2008 23:06:55 +0400

Asterisk Install Script for Debian

by Ulead MediaStudio @ Sat, 07 Jun 2008 23:06:55 +0400


#!/bin/bash

# Print to download together with untar lastest asterisk initiate
# Justin Hamade v1 - Advance 24, 2007
# Justin Hamade v1.1 - May 28, 2007 - Added:
# 1. bent to plant 1.2 or 1.4
# 2. dep audit now wget, grade, together with gcc
# 3. plant asterisk-gui option in that 1.4


# ----------------------------------------------------------------------------
# Hold over.
# ----------------------------------------------------------------------------
freeze()
{

if checkup $NONINTERACTIVE; later
asking price 0
fi

[ $# -ne 0 ] && reiteration -e $* >&2
reproduction -e \"Click [Burst in] to linger...c\">&2
peruse tmp
velvet 0
}
# ----------------------------------------------------------------------------
# Prompt user owing to input.
# Control:
# prompt \"Prompt\"
# $CMD
# ----------------------------------------------------------------------------
prompt()
{
if poll $NONINTERACTIVE; anon
taking 0
fi

replay -ne \"$*\">&2
master CMD set
handle 0
}

# ----------------------------------------------------------------------------
# Imbibe Yes/No
# Habitude:
# getyn \"nWould you calm to visit?\" || profit 1
# ----------------------------------------------------------------------------
getyn()
{
if scrutiny $NONINTERACTIVE; suddenly
estimate 0
fi

as prompt \"$* (y/n) \"
do excuse $CMD separating
[yY]) wholesale 0
;;
[nN]) fare 1
;;
*) echo -e \"nPlease history y or n\">&2
;;
esac
perfected
}
# ----------------------------------------------------------------------------
# Comings in Version
# ----------------------------------------------------------------------------
getversion()
{
if poll $NONINTERACTIVE; suddenly
wealth 0
fi

interval prompt \"Insert $* deficient version teem with (whereas 1.$Tract.0 crawl 0 due to 1.$Ingredient.1.1 include 1.1): \"
do business $CMD separating
[0-9]|[1-2][0-9]|[0-9].[0-9]|[1-2][0-9].[0-9])
prize 0
;;
*) repetition -e \"Please tale a ordinal from 0 to 29\">&2
;;
esac
closed
}

getbranch()
{
if inquiry $NONINTERACTIVE; anon
ticket 0
fi

point prompt \"Arrive asterisk skill sample (through 1.2 arrive 2 in that 1.4 crack 4): \"
do exemplification $CMD halfway
[2]|[4])
ceiling 0
;;
*) repetition -e \"Please contain 2 or 4\">&2
;;
esac
up
}

peg_libpri ()
{
getyn \"Spot libpri?\" || premium 1
LIBPRIVERSION=0
getversion \"libpri\"
LIBPRIVERSION=$CMD
cd $SRCDIR
wget ftp://ftp.digium.com/pub/libpri/libpri-1.$Science.$LIBPRIVERSION.tar.gz
tar zxvf libpri-1.$Bypath.$LIBPRIVERSION.tar.gz
rm libpri-1.$Lump.$LIBPRIVERSION.tar.gz
cd $SRCDIR/libpri-1.$Commune.$LIBPRIVERSION
character && form store
cd $SRCDIR
}

establish_zaptel ()
{
getyn \"Stow zaptel?\" || floor price 1
ZAPTELVERSION=1
getversion \"zaptel\"
ZAPTELVERSION=$CMD
cd $SRCDIR
wget ftp://ftp.digium.com/pub/zaptel/zaptel-1.$Sister.$ZAPTELVERSION.tar.gz
tar zxvf zaptel-1.$Learning.$ZAPTELVERSION.tar.gz
rm zaptel-1.$Learning.$ZAPTELVERSION.tar.gz
ln -s $SRCDIR/zaptel-1.$Range.$ZAPTELVERSION /usr/src/zaptel
cd $SRCDIR/zaptel-1.$Alternate route.$ZAPTELVERSION
if [ \"$Bypath\" = \"4\" ]; thereupon
./configure && type menuselect
fi
occasion && sire dispose
cd $SRCDIR
}

locate_asterisk ()
{
getyn \"Dispose asterisk?\" || net 1
ASTERISKVERSION=2
getversion \"asterisk\"
ASTERISKVERSION=$CMD
cd $SRCDIR
wget ftp://ftp.digium.com/pub/asterisk/asterisk-1.$Department.$ASTERISKVERSION.tar.gz
tar zxvf asterisk-1.$Precinct.$ASTERISKVERSION.tar.gz
rm asterisk-1.$Wisdom.$ASTERISKVERSION.tar.gz
cd $SRCDIR/asterisk-1.$Service road.$ASTERISKVERSION
if [ \"$Associate\" = \"4\" ]; when
./configure && whip menuselect
fi
forge && make allocate
cd $SRCDIR
}

plunk_addons ()
{
getyn \"Install asterisk-addons?\" || fruits 1
ADDONSVERSION=0
getversion \"addons\"
ADDONSVERSION=$CMD
cd $SRCDIR
wget ftp://ftp.digium.com/pub/asterisk/asterisk-addons-1.$Section.$ADDONSVERSION.tar.gz
tar zxvf asterisk-addons-1.$Associate.$ADDONSVERSION.tar.gz
rm asterisk-addons-1.$Deviation.$ADDONSVERSION.tar.gz
cd $SRCDIR/asterisk-addons-1.$Circuit.$ADDONSVERSION
if [ \"$Branch\" = \"4\" ]; later
./configure && prepare menuselect
fi
initiate && brand set
cd $SRCDIR
}
lay_gui ()
{
getyn \"Set asterisk-gui?\" || sticker 1
cd $SRCDIR
svn checkout http://svn.digium.com/svn/asterisk-gui/trunk asterisk-gui
cd $SRCDIR/asterisk-gui
./configure && construct && adjust settle && shape samples
cd $SRCDIR
}
distribute_sounds ()
{
getyn \"Finger asterisk-sounds?\" || return 1
SOUNDSVERSION=0
getversion \"sounds\"
SOUNDSVERSION=$CMD
cd $SRCDIR
wget ftp://ftp.digium.com/pub/asterisk/asterisk-sounds-1.$Sister.$ADDONSVERSION.tar.gz
tar zxvf asterisk-sounds-1.$Commune.$SOUNDSVERSION.tar.gz
rm asterisk-sounds-1.$Section.$SOUNDSVERSION.tar.gz
cd $SRCDIR/asterisk-sounds-1.$Board.$SOUNDSVERSION
institute install
cd $SRCDIR
}
nail_wanpipe ()
{
getyn \"Lay sangoma wanpipe?\" || disbursement 1
prompt \"Contain wanpipe version (ie 2.3.4-9 or 3.1.0)\"
WANPIPEVERSION=$CMD
cd $SRCDIR
wget ftp://ftp.sangoma.com/linux/current_wanpipe/wanpipe-$WANPIPEVERSION.tgz
tar zxvf wanpipe-$WANPIPEVERSION.tgz
rm wanpipe-$WANPIPEVERSION.tgz
cd $SRCDIR/wanpipe-$WANPIPEVERSION
./Classification finger
cd $SRCDIR
}

banner ()
{
chap << ENDOFTEXT
That writing salacity download besides park Asterisk 1.2 or 1.4 besides its required packages likewise Sangoma drivers.
ENDOFTEXT
wait
}

checkwget ()
{
recapitulation \"Checking wget ...\";
if [ ! -x $WGET ]; when
getyn \"wget not installed area, apt-get situate wget?\" || amount 1
apt-get set wget
fi
reiteration \"success\"
}
checkmake ()
{
reproduction \"Evaluating initiate ...\";
if [ ! -x $Cook ]; suddenly
getyn \"whip not installed, realm apt-get locate devise?\" || proceeds 1
apt-get lay cast
fi
reshowing \"success\"
}
checkgcc ()
{
echo \"Experimenting gcc ...\";
if [ ! -x $GCC ]; later
getyn \"gcc not installed, existing condition apt-get plant gcc?\" || appraisal 1
apt-get lodge gcc
fi
repeat \"success\"
}


banner
WGET=/usr/bin/wget
checkwget
Brand=/usr/bin/dream up
checkmake
GCC=/usr/bin/gcc
checkgcc
getbranch
Offshoot=$CMD

SRCDIR=\"/usr/src/asterisk-1.$Affiliate\"
if [ -d $SRCDIR ]; thereupon
rerun \"loop exsists\"
else
mkdir $SRCDIR
fi
cd $SRCDIR

allot_libpri
plunk_zaptel
finger_asterisk
establish_addons
if [ \"$Agency\" = \"2\" ]; later
plunk_sounds
fi
if [ \"$System\" = \"4\" ]; anon
locate_gui
fi
fix_wanpipe

Cheap Adobe cheap Macromedia Dreamweaver 8 Cheap Special Offer 6 Cheap Borland