forked from levisjani/fufix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·136 lines (115 loc) · 4.75 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
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
cat includes/banner
source includes/versions
source includes/functions.sh
while getopts uhUH:D:? par; do
case $par in
h|'?')
usage
exit 0
;;
u|U)
[[ ${par} == "U" ]] && inst_confirm_proceed="no"
is_upgradetask="yes"
;;
H) sys_hostname="$OPTARG" ;;
D) sys_domain="$OPTARG" ;;
esac
done
if [[ ${is_upgradetask} == "yes" ]]; then
upgradetask
echo ${mailcow_version} > /etc/mailcow_version
echo --------------------------------- >> installer.log
echo UPGRADE to ${mailcow_version} on $(date) >> installer.log
echo --------------------------------- >> installer.log
echo Roundcube version: ${roundcube_version} >> installer.log
echo FuGlu version: ${fuglu_version} >> installer.log
echo --------------------------------- >> installer.log
exit 0
fi
source mailcow.config
checksystem
checkports
checkconfig
echo
echo " $(textb "Hostname") ${sys_hostname}
$(textb "Domain") ${sys_domain}
$(textb "FQDN") ${sys_hostname}.${sys_domain}
$(textb "Timezone") ${sys_timezone}
$(textb "mailcow MySQL") ${my_mailcowuser}:${my_mailcowpass}@${my_dbhost}/${my_mailcowdb}
$(textb "Roundcube MySQL") ${my_rcuser}:${my_rcpass}@${my_dbhost}/${my_rcdb}
$(textb "mailcow admin user") ${mailcow_admin_user}
"
returnwait "Reading configuration" "System environment"
echo --------------------------------- > installer.log
echo MySQL database host: ${my_dbhost} >> installer.log
echo --------------------------------- >> installer.log
echo MySQL mailcow database: ${my_mailcowdb} >> installer.log
echo MySQL mailcow username: ${my_mailcowuser} >> installer.log
echo MySQL mailcow password: ${my_mailcowpass} >> installer.log
echo --------------------------------- >> installer.log
echo MySQL Roundcube database: ${my_rcdb} >> installer.log
echo MySQL Roundcube username: ${my_rcuser} >> installer.log
echo MySQL Roundcube password: ${my_rcpass} >> installer.log
echo --------------------------------- >> installer.log
echo Only set when MySQL was not available >> installer.log
echo MySQL root password: ${my_rootpw} >> installer.log
echo --------------------------------- >> installer.log
echo mailcow administrator >> installer.log
echo Username: ${mailcow_admin_user} >> installer.log
echo Password: ${mailcow_admin_pass} >> installer.log
echo --------------------------------- >> installer.log
echo FQDN: ${sys_hostname}.${sys_domain} >> installer.log
echo Timezone: ${sys_timezone} >> installer.log
echo --------------------------------- >> installer.log
echo Web root: https://${sys_hostname}.${sys_domain} >> installer.log
echo DAV web root: https://${httpd_dav_subdomain}.${sys_domain} >> installer.log
echo --------------------------------- >> installer.log
echo Roundcube version: $roundcube_version >> installer.log
echo FuGlu version: ${fuglu_version} >> installer.log
echo mailcow version: ${mailcow_version} >> installer.log
echo --------------------------------- >> installer.log
installtask environment
returnwait "System environment" "Package installation"
installtask installpackages
returnwait "Package installation" "Certificate configuration"
installtask ssl
returnwait "Certificate configuration" "MySQL configuration"
installtask mysql
returnwait "MySQL configuration" "Postfix configuration"
installtask postfix
returnwait "Postfix configuration" "Dovecot configuration"
installtask dovecot
returnwait "Dovecot configuration" "FuGlu configuration"
installtask fuglu
returnwait "FuGlu configuration" "ClamAV configuration"
installtask clamav
returnwait "ClamAV configuration" "Spamassassin configuration"
installtask spamassassin
returnwait "Spamassassin configuration" "Webserver configuration"
installtask webserver
returnwait "Webserver configuration" "Roundcube configuration"
installtask roundcube
returnwait "Roundcube configuration" "OpenDKIM configuration"
installtask opendkim
returnwait "OpenDKIM configuration" "Restarting services"
installtask restartservices
returnwait "Restarting services" "Finish installation"
echo ${mailcow_version} > /etc/mailcow_version
chmod 600 installer.log
echo
echo "`tput setaf 2`Finished installation`tput sgr0`"
echo "Logged credentials and further information to file `tput bold`installer.log`tput sgr0`."
echo
echo "Next steps:"
echo " * Backup installer.log to a safe place and delete it from your server"
echo " * Login to https://$sys_hostname.$sys_domain\" (pease use the full URL and not your IP address)"
echo " Username: ${mailcow_admin_user}"
echo " Password: ${mailcow_admin_pass}"
echo " * Please recheck PTR records in ReverseDNS for both IPv4 and IPv6, also verify you have setup SPF TXT records."
echo " * Please see the wiki for help @ https://github.com/andryyy/mailcow/wiki before opening an issue"
echo