commit | author | age
|
8896ab
|
1 |
<?php |
N |
2 |
|
|
3 |
/* |
|
4 |
Copyright (c) 2007-2010, Till Brehm, projektfarm Gmbh |
|
5 |
All rights reserved. |
|
6 |
|
|
7 |
Redistribution and use in source and binary forms, with or without modification, |
|
8 |
are permitted provided that the following conditions are met: |
|
9 |
|
|
10 |
* Redistributions of source code must retain the above copyright notice, |
|
11 |
this list of conditions and the following disclaimer. |
|
12 |
* Redistributions in binary form must reproduce the above copyright notice, |
|
13 |
this list of conditions and the following disclaimer in the documentation |
|
14 |
and/or other materials provided with the distribution. |
|
15 |
* Neither the name of ISPConfig nor the names of its contributors |
|
16 |
may be used to endorse or promote products derived from this software without |
|
17 |
specific prior written permission. |
|
18 |
|
|
19 |
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND |
|
20 |
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
|
21 |
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
|
22 |
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, |
|
23 |
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, |
|
24 |
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
|
25 |
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
|
26 |
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING |
|
27 |
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, |
|
28 |
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
|
29 |
*/ |
|
30 |
|
|
31 |
/* |
|
32 |
ISPConfig 3 updater. |
|
33 |
*/ |
|
34 |
|
|
35 |
error_reporting(E_ALL|E_STRICT); |
|
36 |
|
eac72c
|
37 |
define('INSTALLER_RUN', true); |
T |
38 |
|
8896ab
|
39 |
//** The banner on the command line |
N |
40 |
echo "\n\n".str_repeat('-',80)."\n"; |
|
41 |
echo " _____ ___________ _____ __ _ ____ |
|
42 |
|_ _/ ___| ___ \ / __ \ / _(_) /__ \ |
|
43 |
| | \ `--.| |_/ / | / \/ ___ _ __ | |_ _ __ _ _/ / |
|
44 |
| | `--. \ __/ | | / _ \| '_ \| _| |/ _` | |_ | |
|
45 |
_| |_/\__/ / | | \__/\ (_) | | | | | | | (_| | ___\ \ |
|
46 |
\___/\____/\_| \____/\___/|_| |_|_| |_|\__, | \____/ |
|
47 |
__/ | |
|
48 |
|___/ "; |
|
49 |
echo "\n".str_repeat('-',80)."\n"; |
|
50 |
echo "\n\n>> Update \n\n"; |
|
51 |
|
|
52 |
//** Include the library with the basic installer functions |
|
53 |
require_once('lib/install.lib.php'); |
|
54 |
|
|
55 |
//** Include the library with the basic updater functions |
|
56 |
require_once('lib/update.lib.php'); |
|
57 |
|
|
58 |
//** Include the base class of the installer class |
|
59 |
require_once('lib/installer_base.lib.php'); |
|
60 |
|
|
61 |
//** Ensure that current working directory is install directory |
|
62 |
$cur_dir = getcwd(); |
|
63 |
if(realpath(dirname(__FILE__)) != $cur_dir) die("Please run installation/update from _inside_ the install directory!\n"); |
|
64 |
|
|
65 |
//** Install logfile |
|
66 |
define('ISPC_LOG_FILE', '/var/log/ispconfig_install.log'); |
|
67 |
define('ISPC_INSTALL_ROOT', realpath(dirname(__FILE__).'/../')); |
|
68 |
|
|
69 |
//** Check for ISPConfig 2.x versions |
|
70 |
if(is_dir('/root/ispconfig') || is_dir('/home/admispconfig')) { |
|
71 |
die('This software cannot be installed on a server wich runs ISPConfig 2.x.'); |
|
72 |
} |
|
73 |
|
|
74 |
//** Get distribution identifier |
|
75 |
$dist = get_distname(); |
|
76 |
|
|
77 |
include_once("/usr/local/ispconfig/server/lib/config.inc.php"); |
|
78 |
$conf_old = $conf; |
|
79 |
unset($conf); |
|
80 |
|
|
81 |
if($dist['id'] == '') die('Linux distribution or version not recognized.'); |
|
82 |
|
|
83 |
//** Include the distribution-specific installer class library and configuration |
|
84 |
if(is_file('dist/lib/'.$dist['baseid'].'.lib.php')) include_once('dist/lib/'.$dist['baseid'].'.lib.php'); |
|
85 |
include_once('dist/lib/'.$dist['id'].'.lib.php'); |
|
86 |
include_once('dist/conf/'.$dist['id'].'.conf.php'); |
|
87 |
|
|
88 |
//** Get hostname |
|
89 |
exec('hostname -f', $tmp_out); |
|
90 |
$conf['hostname'] = $tmp_out[0]; |
|
91 |
unset($tmp_out); |
|
92 |
|
|
93 |
//** Set the mysql login information |
|
94 |
$conf["mysql"]["host"] = $conf_old["db_host"]; |
|
95 |
$conf["mysql"]["database"] = $conf_old["db_database"]; |
|
96 |
$conf['mysql']['charset'] = 'utf8'; |
|
97 |
$conf["mysql"]["ispconfig_user"] = $conf_old["db_user"]; |
|
98 |
$conf["mysql"]["ispconfig_password"] = $conf_old["db_password"]; |
|
99 |
$conf['language'] = $conf_old['language']; |
d6b361
|
100 |
$conf['theme'] = $conf_old['theme']; |
8896ab
|
101 |
if($conf['language'] == '{language}') $conf['language'] = 'en'; |
355efb
|
102 |
$conf['timezone'] = (isset($conf_old['timezone']))?$conf_old['timezone']:'UTC'; |
8cf78b
|
103 |
if($conf['timezone'] == '{timezone}' or trim($conf['timezone']) == '') $conf['timezone'] = 'UTC'; |
1ccb3b
|
104 |
$conf['language_file_import_enabled'] = (isset($conf_old['language_file_import_enabled']))?$conf_old['language_file_import_enabled']:true; |
8896ab
|
105 |
|
N |
106 |
if(isset($conf_old["dbmaster_host"])) $conf["mysql"]["master_host"] = $conf_old["dbmaster_host"]; |
|
107 |
if(isset($conf_old["dbmaster_database"])) $conf["mysql"]["master_database"] = $conf_old["dbmaster_database"]; |
|
108 |
if(isset($conf_old["dbmaster_user"])) $conf["mysql"]["master_ispconfig_user"] = $conf_old["dbmaster_user"]; |
|
109 |
if(isset($conf_old["dbmaster_password"])) $conf["mysql"]["master_ispconfig_password"] = $conf_old["dbmaster_password"]; |
|
110 |
|
|
111 |
//* Check if this is a master / slave setup |
|
112 |
if($conf["mysql"]["master_host"] != '' && $conf["mysql"]["host"] != $conf["mysql"]["master_host"]) { |
|
113 |
$conf['mysql']['master_slave_setup'] = 'y'; |
|
114 |
} |
|
115 |
|
|
116 |
// Resolve the IP address of the mysql hostname. |
|
117 |
if(!$conf['mysql']['ip'] = gethostbyname($conf['mysql']['host'])) die('Unable to resolve hostname'.$conf['mysql']['host']); |
|
118 |
|
|
119 |
$conf['server_id'] = intval($conf_old["server_id"]); |
|
120 |
$conf['ispconfig_log_priority'] = $conf_old["log_priority"]; |
|
121 |
|
|
122 |
$inst = new installer(); |
|
123 |
$inst->is_update = true; |
|
124 |
|
|
125 |
//** Detect the installed applications |
|
126 |
$inst->find_installed_apps(); |
|
127 |
|
8cf78b
|
128 |
echo "This application will update ISPConfig 3 on your server.\n\n"; |
T |
129 |
|
|
130 |
//* Make a backup before we start the update |
|
131 |
$do_backup = $inst->simple_query('Shall the script create a ISPConfig backup in /var/backup/ now?', array('yes','no'),'yes'); |
|
132 |
if($do_backup == 'yes') { |
|
133 |
|
|
134 |
//* Create the backup directory |
0c7569
|
135 |
$backup_path = '/var/backup/ispconfig_'.@date('Y-m-d_H-i'); |
8cf78b
|
136 |
$conf['backup_path'] = $backup_path; |
T |
137 |
exec("mkdir -p $backup_path"); |
|
138 |
exec("chown root:root $backup_path"); |
|
139 |
exec("chmod 700 $backup_path"); |
|
140 |
|
|
141 |
//* Do the backup |
|
142 |
swriteln('Creating backup of "/usr/local/ispconfig" directory...'); |
|
143 |
exec("tar pcfz $backup_path/ispconfig_software.tar.gz /usr/local/ispconfig 2> /dev/null",$out,$returnvar); |
|
144 |
if($returnvar != 0) die("Backup failed. We stop here...\n"); |
|
145 |
|
|
146 |
swriteln('Creating backup of "/etc" directory...'); |
|
147 |
exec("tar pcfz $backup_path/etc.tar.gz /etc 2> /dev/null",$out,$returnvar); |
|
148 |
if($returnvar != 0) die("Backup failed. We stop here...\n"); |
|
149 |
|
|
150 |
exec("chown root:root $backup_path/*.tar.gz"); |
|
151 |
exec("chmod 700 $backup_path/*.tar.gz"); |
|
152 |
} |
|
153 |
|
8896ab
|
154 |
|
N |
155 |
//** Initialize the MySQL server connection |
|
156 |
include_once('lib/mysql.lib.php'); |
|
157 |
|
|
158 |
//** Database update is a bit brute force and should be rebuild later ;) |
|
159 |
|
|
160 |
/* |
|
161 |
* Try to read the DB-admin settings |
|
162 |
*/ |
|
163 |
$clientdb_host = ''; |
|
164 |
$clientdb_user = ''; |
|
165 |
$clientdb_password = ''; |
|
166 |
include_once("/usr/local/ispconfig/server/lib/mysql_clientdb.conf"); |
|
167 |
$conf["mysql"]["admin_user"] = $clientdb_user; |
|
168 |
$conf["mysql"]["admin_password"] = $clientdb_password; |
|
169 |
$clientdb_host = ''; |
|
170 |
$clientdb_user = ''; |
|
171 |
$clientdb_password = ''; |
|
172 |
|
edf806
|
173 |
//** Test mysql root connection |
T |
174 |
$finished = false; |
|
175 |
do { |
|
176 |
if(@mysql_connect($conf["mysql"]["host"],$conf["mysql"]["admin_user"],$conf["mysql"]["admin_password"])) { |
|
177 |
$finished = true; |
|
178 |
} else { |
|
179 |
swriteln($inst->lng('Unable to connect to mysql server').' '.mysql_error()); |
|
180 |
$conf["mysql"]["admin_password"] = $inst->free_query('MySQL root password', $conf['mysql']['admin_password']); |
|
181 |
} |
|
182 |
} while ($finished == false); |
|
183 |
unset($finished); |
8896ab
|
184 |
|
N |
185 |
/* |
|
186 |
* Prepare the dump of the database |
|
187 |
*/ |
|
188 |
prepareDBDump(); |
|
189 |
|
|
190 |
//* initialize the database |
|
191 |
$inst->db = new db(); |
|
192 |
|
|
193 |
//* initialize the master DB, if we have a multiserver setup |
|
194 |
if($conf['mysql']['master_slave_setup'] == 'y') { |
|
195 |
//** Get MySQL root credentials |
|
196 |
$finished = false; |
|
197 |
do { |
|
198 |
$tmp_mysql_server_host = $inst->free_query('MySQL master server hostname', $conf['mysql']['master_host']); |
|
199 |
$tmp_mysql_server_admin_user = $inst->free_query('MySQL master server root username', $conf['mysql']['master_admin_user']); |
|
200 |
$tmp_mysql_server_admin_password = $inst->free_query('MySQL master server root password', $conf['mysql']['master_admin_password']); |
|
201 |
$tmp_mysql_server_database = $inst->free_query('MySQL master server database name', $conf['mysql']['master_database']); |
|
202 |
|
|
203 |
//* Initialize the MySQL server connection |
|
204 |
if(@mysql_connect($tmp_mysql_server_host, $tmp_mysql_server_admin_user, $tmp_mysql_server_admin_password)) { |
|
205 |
$conf['mysql']['master_host'] = $tmp_mysql_server_host; |
|
206 |
$conf['mysql']['master_admin_user'] = $tmp_mysql_server_admin_user; |
|
207 |
$conf['mysql']['master_admin_password'] = $tmp_mysql_server_admin_password; |
|
208 |
$conf['mysql']['master_database'] = $tmp_mysql_server_database; |
|
209 |
$finished = true; |
|
210 |
} else { |
|
211 |
swriteln($inst->lng('Unable to connect to mysql server').' '.mysql_error()); |
|
212 |
} |
|
213 |
} while ($finished == false); |
|
214 |
unset($finished); |
|
215 |
|
|
216 |
// initialize the connection to the master database |
|
217 |
$inst->dbmaster = new db(); |
|
218 |
if($inst->dbmaster->linkId) $inst->dbmaster->closeConn(); |
|
219 |
$inst->dbmaster->dbHost = $conf['mysql']["master_host"]; |
|
220 |
$inst->dbmaster->dbName = $conf['mysql']["master_database"]; |
|
221 |
$inst->dbmaster->dbUser = $conf['mysql']["master_admin_user"]; |
|
222 |
$inst->dbmaster->dbPass = $conf['mysql']["master_admin_password"]; |
|
223 |
} else { |
|
224 |
$inst->dbmaster = $inst->db; |
|
225 |
} |
|
226 |
|
|
227 |
/* |
|
228 |
* Check all tables |
|
229 |
*/ |
|
230 |
checkDbHealth(); |
|
231 |
|
|
232 |
/* |
|
233 |
* dump the new Database and reconfigure the server.ini |
|
234 |
*/ |
|
235 |
updateDbAndIni(); |
|
236 |
|
|
237 |
/* |
|
238 |
* Reconfigure the permisson if needed |
|
239 |
* (if this is done at client side, only this client is updated. |
|
240 |
* If this is done at server side, all clients are updated. |
|
241 |
*/ |
|
242 |
//if($conf_old['dbmaster_user'] != '' or $conf_old['dbmaster_host'] != '') { |
|
243 |
//** Update master database rights |
|
244 |
$reconfigure_master_database_rights_answer = $inst->simple_query('Reconfigure Permissions in master database?', array('yes','no'),'no'); |
|
245 |
|
|
246 |
if($reconfigure_master_database_rights_answer == 'yes') { |
|
247 |
$inst->grant_master_database_rights(); |
|
248 |
} |
|
249 |
//} |
|
250 |
|
|
251 |
//** Shall the services be reconfigured during update |
|
252 |
$reconfigure_services_answer = $inst->simple_query('Reconfigure Services?', array('yes','no'),'yes'); |
|
253 |
|
|
254 |
if($reconfigure_services_answer == 'yes') { |
|
255 |
|
|
256 |
if($conf['services']['mail']) { |
|
257 |
//** Configure postfix |
|
258 |
swriteln('Configuring Postfix'); |
|
259 |
$inst->configure_postfix('dont-create-certs'); |
|
260 |
|
|
261 |
//** Configure mailman |
|
262 |
swriteln('Configuring Mailman'); |
|
263 |
$inst->configure_mailman('update'); |
|
264 |
|
|
265 |
//* Configure Jailkit |
|
266 |
swriteln('Configuring Jailkit'); |
|
267 |
$inst->configure_jailkit(); |
|
268 |
|
|
269 |
if($conf['dovecot']['installed'] == true) { |
|
270 |
//* Configure dovecot |
|
271 |
swriteln('Configuring Dovecot'); |
|
272 |
$inst->configure_dovecot(); |
|
273 |
} else { |
|
274 |
//** Configure saslauthd |
|
275 |
swriteln('Configuring SASL'); |
|
276 |
$inst->configure_saslauthd(); |
|
277 |
|
|
278 |
//** Configure PAM |
|
279 |
swriteln('Configuring PAM'); |
|
280 |
$inst->configure_pam(); |
|
281 |
|
|
282 |
//* Configure courier |
|
283 |
swriteln('Configuring Courier'); |
|
284 |
$inst->configure_courier(); |
|
285 |
} |
|
286 |
|
|
287 |
//** Configure Spamasassin |
|
288 |
swriteln('Configuring Spamassassin'); |
|
289 |
$inst->configure_spamassassin(); |
|
290 |
|
|
291 |
//** Configure Amavis |
|
292 |
swriteln('Configuring Amavisd'); |
|
293 |
$inst->configure_amavis(); |
|
294 |
|
|
295 |
//** Configure Getmail |
|
296 |
swriteln('Configuring Getmail'); |
|
297 |
$inst->configure_getmail(); |
|
298 |
} |
|
299 |
|
|
300 |
if($conf['services']['web'] && $conf['pureftpd']['installed'] == true) { |
|
301 |
//** Configure Pureftpd |
|
302 |
swriteln('Configuring Pureftpd'); |
|
303 |
$inst->configure_pureftpd(); |
|
304 |
} |
|
305 |
|
|
306 |
if($conf['services']['dns']) { |
|
307 |
//* Configure DNS |
|
308 |
if($conf['powerdns']['installed'] == true) { |
|
309 |
swriteln('Configuring PowerDNS'); |
|
310 |
$inst->configure_powerdns(); |
|
311 |
} elseif($conf['bind']['installed'] == true) { |
|
312 |
swriteln('Configuring BIND'); |
|
313 |
$inst->configure_bind(); |
|
314 |
} else { |
|
315 |
swriteln('Configuring MyDNS'); |
|
316 |
$inst->configure_mydns(); |
|
317 |
} |
|
318 |
} |
|
319 |
|
|
320 |
if($conf['services']['web']) { |
4ffb51
|
321 |
if($conf['webserver']['server_type'] == 'apache'){ |
F |
322 |
//** Configure Apache |
|
323 |
swriteln('Configuring Apache'); |
|
324 |
$inst->configure_apache(); |
8896ab
|
325 |
|
4ffb51
|
326 |
//** Configure vlogger |
F |
327 |
swriteln('Configuring vlogger'); |
|
328 |
$inst->configure_vlogger(); |
|
329 |
} else { |
|
330 |
//** Configure nginx |
|
331 |
swriteln('Configuring nginx'); |
|
332 |
$inst->configure_nginx(); |
|
333 |
} |
8896ab
|
334 |
|
N |
335 |
//** Configure apps vhost |
|
336 |
swriteln('Configuring Apps vhost'); |
|
337 |
$inst->configure_apps_vhost(); |
|
338 |
} |
|
339 |
|
|
340 |
|
|
341 |
//* Configure DBServer |
|
342 |
swriteln('Configuring Database'); |
|
343 |
$inst->configure_dbserver(); |
|
344 |
|
|
345 |
|
|
346 |
if($conf['services']['firewall']) { |
|
347 |
if($conf['bastille']['installed'] == true) { |
|
348 |
//* Configure Bastille Firewall |
|
349 |
swriteln('Configuring Bastille Firewall'); |
|
350 |
$inst->configure_firewall(); |
|
351 |
} |
|
352 |
} |
|
353 |
|
4ffb51
|
354 |
/* |
8896ab
|
355 |
if($conf['squid']['installed'] == true) { |
N |
356 |
swriteln('Configuring Squid'); |
|
357 |
$inst->configure_squid(); |
|
358 |
} else if($conf['nginx']['installed'] == true) { |
|
359 |
swriteln('Configuring Nginx'); |
|
360 |
$inst->configure_nginx(); |
|
361 |
} |
4ffb51
|
362 |
*/ |
8896ab
|
363 |
} |
N |
364 |
|
|
365 |
//** Configure ISPConfig |
|
366 |
swriteln('Updating ISPConfig'); |
|
367 |
|
|
368 |
|
b67344
|
369 |
if ($conf['services']['web'] && $inst->install_ispconfig_interface) { |
8896ab
|
370 |
//** Customise the port ISPConfig runs on |
N |
371 |
$ispconfig_port_number = get_ispconfig_port_number(); |
4ffb51
|
372 |
if($conf['webserver']['server_type'] == 'nginx'){ |
F |
373 |
$conf['nginx']['vhost_port'] = $inst->free_query('ISPConfig Port', $ispconfig_port_number); |
|
374 |
} else { |
|
375 |
$conf['apache']['vhost_port'] = $inst->free_query('ISPConfig Port', $ispconfig_port_number); |
|
376 |
} |
|
377 |
|
8896ab
|
378 |
|
N |
379 |
// $ispconfig_ssl_default = (is_ispconfig_ssl_enabled() == true)?'y':'n'; |
|
380 |
if(strtolower($inst->simple_query('Create new ISPConfig SSL certificate',array('yes','no'),'no')) == 'yes') { |
|
381 |
$inst->make_ispconfig_ssl_cert(); |
|
382 |
} |
|
383 |
} |
|
384 |
|
|
385 |
$inst->install_ispconfig(); |
|
386 |
|
|
387 |
//** Configure Crontab |
|
388 |
$update_crontab_answer = $inst->simple_query('Reconfigure Crontab?', array('yes','no'),'yes'); |
|
389 |
if($update_crontab_answer == 'yes') { |
|
390 |
swriteln('Updating Crontab'); |
|
391 |
$inst->install_crontab(); |
|
392 |
} |
|
393 |
|
|
394 |
//** Restart services: |
|
395 |
if($reconfigure_services_answer == 'yes') { |
|
396 |
swriteln('Restarting services ...'); |
|
397 |
if($conf['mysql']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['mysql']['init_script'])) system($conf['init_scripts'].'/'.$conf['mysql']['init_script'].' restart'); |
|
398 |
if($conf['services']['mail']) { |
|
399 |
if($conf['postfix']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['postfix']['init_script'])) system($conf['init_scripts'].'/'.$conf['postfix']['init_script'].' restart'); |
|
400 |
if($conf['saslauthd']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['saslauthd']['init_script'])) system($conf['init_scripts'].'/'.$conf['saslauthd']['init_script'].' restart'); |
|
401 |
if($conf['amavis']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['amavis']['init_script'])) system($conf['init_scripts'].'/'.$conf['amavis']['init_script'].' restart'); |
|
402 |
if($conf['clamav']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['clamav']['init_script'])) system($conf['init_scripts'].'/'.$conf['clamav']['init_script'].' restart'); |
|
403 |
if($conf['courier']['courier-authdaemon'] != '' && is_executable($conf['init_scripts'].'/'.$conf['courier']['courier-authdaemon'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-authdaemon'].' restart'); |
|
404 |
if($conf['courier']['courier-imap'] != '' && is_executable($conf['init_scripts'].'/'.$conf['courier']['courier-imap'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-imap'].' restart'); |
|
405 |
if($conf['courier']['courier-imap-ssl'] != '' && is_executable($conf['init_scripts'].'/'.$conf['courier']['courier-imap-ssl'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-imap-ssl'].' restart'); |
|
406 |
if($conf['courier']['courier-pop'] != '' && is_executable($conf['init_scripts'].'/'.$conf['courier']['courier-pop'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-pop'].' restart'); |
|
407 |
if($conf['courier']['courier-pop-ssl'] != '' && is_executable($conf['init_scripts'].'/'.$conf['courier']['courier-pop-ssl'])) system($conf['init_scripts'].'/'.$conf['courier']['courier-pop-ssl'].' restart'); |
|
408 |
if($conf['dovecot']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['dovecot']['init_script'])) system($conf['init_scripts'].'/'.$conf['dovecot']['init_script'].' restart'); |
26c0fc
|
409 |
if($conf['mailman']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['mailman']['init_script'])) system('nohup '.$conf['init_scripts'].'/'.$conf['mailman']['init_script'].' restart >/dev/null 2>&1 &'); |
8896ab
|
410 |
} |
N |
411 |
if($conf['services']['web']) { |
4ffb51
|
412 |
if($conf['webserver']['server_type'] == 'apache' && $conf['apache']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['apache']['init_script'])) system($conf['init_scripts'].'/'.$conf['apache']['init_script'].' restart'); |
F |
413 |
//* Reload is enough for nginx |
|
414 |
if($conf['webserver']['server_type'] == 'nginx'){ |
|
415 |
if($conf['nginx']['php_fpm_init_script'] != '' && @is_file($conf['init_scripts'].'/'.$conf['nginx']['php_fpm_init_script'])) system($conf['init_scripts'].'/'.$conf['nginx']['php_fpm_init_script'].' reload'); |
|
416 |
if($conf['nginx']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['nginx']['init_script'])) system($conf['init_scripts'].'/'.$conf['nginx']['init_script'].' reload'); |
|
417 |
} |
8896ab
|
418 |
if($conf['pureftpd']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['pureftpd']['init_script'])) system($conf['init_scripts'].'/'.$conf['pureftpd']['init_script'].' restart'); |
N |
419 |
} |
|
420 |
if($conf['services']['dns']) { |
|
421 |
if($conf['mydns']['installed'] == true && $conf['mydns']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['mydns']['init_script'])) system($conf['init_scripts'].'/'.$conf['mydns']['init_script'].' restart &> /dev/null'); |
|
422 |
if($conf['powerdns']['installed'] == true && $conf['powerdns']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['powerdns']['init_script'])) system($conf['init_scripts'].'/'.$conf['powerdns']['init_script'].' restart &> /dev/null'); |
|
423 |
if($conf['bind']['installed'] == true && $conf['bind']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['bind']['init_script'])) system($conf['init_scripts'].'/'.$conf['bind']['init_script'].' restart &> /dev/null'); |
|
424 |
} |
|
425 |
|
|
426 |
if($conf['services']['proxy']) { |
c91bdc
|
427 |
// if($conf['squid']['installed'] == true && $conf['squid']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['squid']['init_script'])) system($conf['init_scripts'].'/'.$conf['squid']['init_script'].' restart &> /dev/null'); |
8896ab
|
428 |
if($conf['nginx']['installed'] == true && $conf['nginx']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['nginx']['init_script'])) system($conf['init_scripts'].'/'.$conf['nginx']['init_script'].' restart &> /dev/null'); |
N |
429 |
} |
|
430 |
|
|
431 |
if($conf['services']['firewall']) { |
c91bdc
|
432 |
//if($conf['ufw']['installed'] == true && $conf['ufw']['init_script'] != '' && is_executable($conf['init_scripts'].'/'.$conf['ufw']['init_script'])) system($conf['init_scripts'].'/'.$conf['ufw']['init_script'].' restart &> /dev/null'); |
8896ab
|
433 |
} |
N |
434 |
} |
|
435 |
|
|
436 |
echo "Update finished.\n"; |
|
437 |
|
|
438 |
?> |