-
Notifications
You must be signed in to change notification settings - Fork 22
/
elastix-install-p1.sh
executable file
·140 lines (126 loc) · 4.03 KB
/
elastix-install-p1.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
139
140
#!/bin/sh
#Shut off SElinux & Disable firewall if running.
setenforce 0
sed -i 's/\(^SELINUX=\).*/\SELINUX=disabled/' /etc/selinux/config
#Download Elastix and get it ready to install
if [[ $(which wget) = "" ]]; then
yum install -y wget
fi
if [ -e Elastix-4.0.74-Stable-x86_64-bin-10Feb2016.iso ]; then
echo "ISO is already avalible. Skipping download"
else
wget https://ufpr.dl.sourceforge.net/project/vaak/Elastix/4/Elastix-4.0.74-Stable-x86_64-bin-10Feb2016.iso
fi
if [ -e /etc/yum.repos.d/commercial-addons.repo ]; then
echo "Seems to have an Install attemt that failed. Clean up yum"
rm -f /etc/yum.repos.d/elastix* /etc/yum.repos.d/commercial-addons.repo
yum clean all
yum -y update
fi
yum -y update
yum install -y epel-release
yum install p7zip p7zip-plugins -y
mkdir -p /mnt/iso
if [[ $(which 7z) = "" ]]; then
echo "7x is missing. Try running again"
exit 1
fi
7z x -o/mnt/iso/ Elastix-4.0.74-Stable-x86_64-bin-10Feb2016.iso
sleep 1
#Add CD as local Repository so we can install
echo "
[elastix-cd]
name=Elastix RPM Repo CD
baseurl=file:///mnt/iso/
gpgcheck=0
enabled=1
" > /etc/yum.repos.d/elastix-cd.repo
#Add Online, so it is up to date from the start
echo '[commercial-addons]
name=Commercial-Addons RPM Repository for Elastix
mirrorlist=http://mirror.elastix.org/?release=4&arch=$basearch&repo=commercial_addons
#baseurl=http://repo.elastix.org/elastix/4/commercial_addons/$basearch/
gpgcheck=1
enabled=1
gpgkey=http://repo.elastix.org/elastix/RPM-GPG-KEY-Elastix
[LowayResearch]
name=Loway Research Yum Repository
baseurl=http://yum.loway.ch/RPMS
gpgcheck=0
enabled=1
[iperfex]
name=IPERFEX RPMs repository
baseurl=http://packages.iperfex.com/centos/$releasever/$basearch/
gpgkey=http://packages.iperfex.com/RPM-GPG-KEY-iperfex-repository
enabled=1
gpgcheck=1
' > /etc/yum.repos.d/commercial-addons.repo
echo '[elastix-base]
name=Base RPM Repository for Elastix
mirrorlist=http://mirror.elastix.org/?release=4&arch=$basearch&repo=base
#baseurl=http://repo.elastix.org/elastix/4/base/$basearch/
gpgcheck=1
enabled=1
gpgkey=http://repo.elastix.org/elastix/RPM-GPG-KEY-Elastix
[elastix-updates]
name=Updates RPM Repository for Elastix
mirrorlist=http://mirror.elastix.org/?release=4&arch=$basearch&repo=updates
#baseurl=http://repo.elastix.org/elastix/4/updates/$basearch/
gpgcheck=1
enabled=1
gpgkey=http://repo.elastix.org/elastix/RPM-GPG-KEY-Elastix
[elastix-beta]
name=Beta RPM Repository for Elastix
mirrorlist=http://mirror.elastix.org/?release=4&arch=$basearch&repo=beta
#baseurl=http://repo.elastix.org/elastix/4/beta/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://repo.elastix.org/elastix/RPM-GPG-KEY-Elastix
[elastix-extras]
name=Extras RPM Repository for Elastix
mirrorlist=http://mirror.elastix.org/?release=4&arch=$basearch&repo=extras
#baseurl=http://repo.elastix.org/elastix/4/extras/$basearch/
gpgcheck=1
enabled=1
gpgkey=http://repo.elastix.org/elastix/RPM-GPG-KEY-Elastix
' > /etc/yum.repos.d/elastix.repo
#Now we do the installation
echo "About to install Elaxtix 4.0.74-Stable-x86_64. You have 5 seconds to press CTRL-C to abort."
sleep 5
yum clean all
yum -y update
sleep 3
yum -y --nogpg install $(cat inst1.txt)
sleep 3
yum -y install asterisk
yum -y install elastix
#Run a 2nd time in case it missed something
yum -y --nogpg install $(cat inst2.txt)
yum -clean all
yum -y update
#Shut off SElinux and Firewall. Be sure to configure it in Elastix!
setenforce 0
sed -i 's/\(^SELINUX=\).*/\SELINUX=disabled/' /etc/selinux/config
cp -a /etc/sysconfig/iptables /etc/sysconfig/iptables.org-elastix-"$(/bin/date "+%Y-%m-%d-%H-%M-%S")"
# systemctl stop chronyd
# systemctl stop firewalld
# systemctl stop iptables
# systemctl disable chronyd
# systemctl disable firewalld
# systemctl disable iptables
# systemctl disable elastix-firstboot
#Fix for "/bin/df: '/etc/fstab': No such file or directory"
touch /etc/fstab
#/etc/rc.d/init.d/elastix-firstboot start
echo " "
echo " "
echo " "
echo " "
echo " "
echo " "
echo "Time to reboot!"
echo " "
echo "Run elastix-install-p2.sh after the reboot."
echo " "
read -p "Press Enter to Reboot, or CTRL-C to abort."
reboot