This repository has been archived by the owner on Oct 22, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathastinstall.sh
executable file
·138 lines (120 loc) · 2.35 KB
/
astinstall.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
#! /bin/bash
HWTYPE=usbradio
#HWTYPE=pciradio
ASTSRCDIR=/usr/src/astsrc
echo "****** Asterisk Installation ******"
sleep 1
ntpdate pool.ntp.org
echo "MENUSELECT_MODULES=wcusb xpp" > /etc/zaptel.makeopts
mkdir -p $ASTSRCDIR
rm -rf $ASTSRCDIR/zaptel $ASTSRCDIR/libpri $ASTSRCDIR/asterisk
cd $ASTSRCDIR
echo "Unpacking files.tar.gz..."
tar xfz files.tar.gz
if [ $? -gt 0 ]
then
echo "Failure: Unable unpack files.tar.gz"
exit 255
fi
rm -f $ASTSRCDIR/asterisk/menuselect.makeopts
rm -f $ASTSRCDIR/Makefile
echo "Compiling Zaptel..."
cd zaptel
./configure
if [ $? -gt 0 ]
then
echo "Failure: Unable to compile Zaptel 1"
exit 255
fi
make
if [ $? -gt 0 ]
then
echo "Failure: Unable to compile Zaptel 2"
exit 255
fi
make install
if [ $? -gt 0 ]
then
echo "Failure: Unable to compile Zaptel 3"
exit 255
fi
make config
if [ $? -gt 0 ]
then
echo "Failure: Unable to compile Zaptel 4"
exit 255
fi
cd ..
echo "Compiling LIBPri..."
cd libpri
make
if [ $? -gt 0 ]
then
echo "Failure: Unable to compile LibPRI 1"
exit 255
fi
make install
if [ $? -gt 0 ]
then
echo "Failure: Unable to compile LibPRI 2"
exit 255
fi
cd ..
cd asterisk
echo "Compiling Asterisk..."
./configure
if [ $? -gt 0 ]
then
echo "Failure: Unable to compile Asterisk 1"
exit 255
fi
make menuselect.makeopts
if [ $? -gt 0 ]
then
echo "Failure: Unable to compile Asterisk 2"
exit 255
fi
sed 's/app_rpt//g;s/chan_usbradio//g;s/MENUSELECT_CFLAGS.*/MENUSELECT_CFLAGS=LOADABLE_MODULES MALLOC_DEBUG RADIO_RELAX/g;s/MENUSELECT_MOH=MOH-FREEPLAY-WAV/MENUSELECT_MOH=/g;s/MENUSELECT_EXTRA_SOUNDS=/MENUSELECT_EXTRA_SOUNDS=EXTRA-SOUNDS-EN-GSM/g' < menuselect.makeopts > foo
if [ $? -ne 0 ]
then
echo "Failure: Unable to edit menuselect.makeopts"
exit 255
fi
mv menuselect.makeopts menuselect.makeopts.old
if [ $? -gt 0 ]
then
echo "Failure: Unable to compile Asterisk 3"
exit 255
fi
mv foo menuselect.makeopts
if [ $? -gt 0 ]
then
echo "Failure: Unable to compile Asterisk 4"
exit 255
fi
make
if [ $? -gt 0 ]
then
echo "Failure: Unable to compile Asterisk 5"
exit 255
fi
make install
if [ $? -gt 0 ]
then
echo "Failure: Unable to compile Asterisk 6"
exit 255
fi
make config
if [ $? -gt 0 ]
then
echo "Failure: Unable to compile Asterisk 7"
exit 255
fi
echo "Copying rpt sounds..."
cp -a $ASTSRCDIR/sounds/* /var/lib/asterisk/sounds
if [ $? -gt 0 ]
then
echo "Failure: Unable to copy rpt sounds"
exit 255
fi
exit 0