forked from dclardy64/ISPConfig-3-Debian-Installer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
140 lines (124 loc) · 3.72 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
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
#!/bin/bash
###############################################################################################
# Complete ISPConfig setup script for Debian/Ubuntu Systems #
# Drew Clardy #
# http://drewclardy.com #
# http://github.com/dclardy64/ISPConfig-3-Debian-Install #
###############################################################################################
# Check if user is root
if [ $(id -u) != "0" ]; then
echo "Error: You must be root to run this script, please use the root user to install the software."
exit 1
fi
if [ ! -f /usr/local/ispconfig/interface/lib/config.inc.php ]; then
ISPConfig_Installed=No
elif [ -f /usr/local/ispconfig/interface/lib/config.inc.php ]; then
ISPConfig_Installed=Yes
fi
# Load Variables
source config.sh
###############
## Libraries ##
###############
# Load Libraries
for file in $LIBRARYPATH/*.sh; do
# Source Libraries
source $file
done
# Check Distribution
if [ $DISTRIBUTION = "none" ]; then
# Error Message
error "Your distribution is unsupported! If you are sure that your distribution is supported please install the lsb-release package as it will improve detection."
# Exit If Not Supported
exit
fi
# Load Libraries (Distribution Specific)
for file in $LIBRARYPATH/platforms/*.$DISTRIBUTION.sh; do
# Source Scripts
source $file
done
# Load Functions (Distribution Specific)
if [ $DISTRIBUTION == "debian" ]; then
source $FUNCTIONPATH/$DISTRIBUTION.functions.sh
elif [ $DISTRIBUTION == "ubuntu" ]; then
source $FUNCTIONPATH/$DISTRIBUTION.functions.sh
fi
# Load Generic Functions
source $FUNCTIONPATH/generic.functions.sh
# Load Extras
for file in $EXTRAPATH/*.install.sh; do
source $file
done
#Execute functions#
if [ $ISPConfig_Installed = "No" ]; then
install_Questions
$DISTRIBUTION.install_Repos
install_Basic
if [ $DISTRIBUTION == "ubuntu"]; then
ubuntu.install_DisableAppArmor
fi
if [ $sql_server == "MySQL" ]; then
$DISTRIBUTION.install_MySQL
fi
if [ $sql_server == "MariaDB" ]; then
$DISTRIBUTION.install_MariaDB
fi
if [ $install_mail_server == "Yes" ]; then
if [ $mail_server == "Courier" ]; then
$DISTRIBUTION.install_Courier
elif [ $mail_server == "Dovecot" ]; then
$DISTRIBUTION.install_Dovecot
fi
$DISTRIBUTION.install_Virus
fi
if [ $install_web_server == "Yes" ]; then
if [ $web_server == "Apache" ]; then
$DISTRIBUTION.install_Apache
elif [ $web_server == "NginX" ]; then
$DISTRIBUTION.install_NginX
fi
$DISTRIBUTION.install_Stats
fi
if [ $mailman == "Yes" ]; then
$DISTRIBUTION.install_Mailman
fi
if [ $install_ftp_server == "Yes" ]; then
$DISTRIBUTION.install_PureFTPD
fi
if [ $install_dns_server == "Yes" ]; then
$DISTRIBUTION.install_Bind
fi
if [ $quota == "Yes" ]; then
$DISTRIBUTION.install_Quota
fi
if [ $jailkit == "Yes" ]; then
$DISTRIBUTION.install_Jailkit
fi
$DISTRIBUTION.install_Fail2Ban
if [ $mail_server == "Courier" ]; then
$DISTRIBUTION.install_Fail2BanRulesCourier
fi
if [ $mail_server == "Dovecot" ]; then
$DISTRIBUTION.install_Fail2BanRulesDovecot
fi
$DISTRIBUTION.install_SquirrelMail
install_ISPConfig
elif [ $ISPConfig_Installed == "Yes" ]; then
warning "ISPConfig 3 already installed! Asking about extra installation scripts."
install_Extras
if [ $extras == "Yes" ]; then
if [ $extra_stuff == "Themes" ]; then
theme_questions
if [ $theme == "ISPC-Clean" ]; then
function_install_ISPC_Clean
fi
elif [ $extra_stuff == "RoundCube" ]; then
roundcube_questions
if [ $web_server == "Apache" ]; then
RoundCube_install_Apache
elif [ $web_server == "NginX" ]; then
RoundCube_install_NginX
fi
fi
fi
fi