forked from fusionpbx/fusionpbx-install.sh
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·68 lines (57 loc) · 1.4 KB
/
install.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
#!/bin/sh
# Copyright H.F. Wang - hsingfoo@gmail.com
clear
verbose () {
echo "${green}$1${normal}"
}
error () {
echo "${red}$1${normal}"
}
# check for color support
if test -t 1; then
# see if it supports colors...
ncolors=$(tput colors)
if test -n "$ncolors" && test $ncolors -ge 8; then
bold="$(tput bold)"
underline="$(tput smul)"
standout="$(tput smso)"
normal="$(tput sgr0)"
black="$(tput setaf 0)"
red="$(tput setaf 1)"
green="$(tput setaf 2)"
yellow="$(tput setaf 3)"
blue="$(tput setaf 4)"
magenta="$(tput setaf 5)"
cyan="$(tput setaf 6)"
white="$(tput setaf 7)"
fi
fi
# check to confirm running as root.
if [ "$(id -u)" -ne "0" ]; then
error "$(basename "$0") must be run as root";
exit 1
fi
#Make ourselves executable next time we are run
chmod +x $0
#Architecture check
if [ `getconf LONG_BIT` = "32" ]
then
echo "32-bit systems are not supported. Exiting."
exit
fi
# Get the rest of the scripts
if [ ! -d /usr/src ]; then
mkdir -vp /usr/src
fi
cd /usr/src
verbose "Fetching Installer"
yum -y -q install git sudo setools
if [ -d /usr/src/fusionpbx-install.sh ]; then
cd /usr/src/fusionpbx-install.sh
git pull
else
git clone -q https://github.com/hsingfoo/fusionpbx-install.sh
fi
chmod -R 755 /usr/src/fusionpbx-install.sh
cd /usr/src/fusionpbx-install.sh/smeserver
./install_smeserver.sh $@