|
300 | 300 | //} |
301 | 301 |
|
302 | 302 | //** Shall the services be reconfigured during update |
303 | | -$reconfigure_services_answer = $inst->simple_query('Reconfigure Services?', array('yes', 'no'), 'yes','reconfigure_services'); |
| 303 | +$reconfigure_services_answer = $inst->simple_query('Reconfigure Services?', array('yes', 'no', 'selected'), 'yes','reconfigure_services'); |
304 | 304 |
|
305 | | -if($reconfigure_services_answer == 'yes') { |
| 305 | +if($reconfigure_services_answer == 'yes' || $reconfigure_services_answer == 'selected') { |
306 | 306 |
|
307 | 307 | if($conf['services']['mail']) { |
| 308 | + |
308 | 309 | //** Configure postfix |
309 | | - swriteln('Configuring Postfix'); |
310 | | - $inst->configure_postfix('dont-create-certs'); |
| 310 | + if($inst->reconfigure_app('Postfix', $reconfigure_services_answer)) { |
| 311 | + swriteln('Configuring Postfix'); |
| 312 | + $inst->configure_postfix('dont-create-certs'); |
| 313 | + } |
311 | 314 |
|
312 | 315 | //** Configure mailman |
313 | | - if($conf['mailman']['installed'] == true) { |
| 316 | + if($conf['mailman']['installed'] == true && $inst->reconfigure_app('Mailman', $reconfigure_services_answer)) { |
314 | 317 | swriteln('Configuring Mailman'); |
315 | 318 | $inst->configure_mailman('update'); |
316 | 319 | } |
317 | 320 |
|
318 | 321 | //* Configure Jailkit |
319 | | - swriteln('Configuring Jailkit'); |
320 | | - $inst->configure_jailkit(); |
| 322 | + if($inst->reconfigure_app('Jailkit', $reconfigure_services_answer)) { |
| 323 | + swriteln('Configuring Jailkit'); |
| 324 | + $inst->configure_jailkit(); |
| 325 | + } |
321 | 326 |
|
322 | | - if($conf['dovecot']['installed'] == true) { |
| 327 | + if($conf['dovecot']['installed'] == true && $inst->reconfigure_app('Dovecot', $reconfigure_services_answer)) { |
323 | 328 | //* Configure dovecot |
324 | 329 | swriteln('Configuring Dovecot'); |
325 | 330 | $inst->configure_dovecot(); |
326 | | - } else { |
| 331 | + } elseif ($conf['courier']['installed'] == true && $inst->reconfigure_app('Courier', $reconfigure_services_answer)) { |
327 | 332 | //** Configure saslauthd |
328 | 333 | swriteln('Configuring SASL'); |
329 | 334 | $inst->configure_saslauthd(); |
|
338 | 343 | } |
339 | 344 |
|
340 | 345 | //** Configure Spamasassin |
341 | | - swriteln('Configuring Spamassassin'); |
342 | | - $inst->configure_spamassassin(); |
| 346 | + if($inst->reconfigure_app('Spamassassin', $reconfigure_services_answer)) { |
| 347 | + swriteln('Configuring Spamassassin'); |
| 348 | + $inst->configure_spamassassin(); |
| 349 | + } |
343 | 350 |
|
344 | 351 | //** Configure Amavis |
345 | | - if($conf['amavis']['installed'] == true) { |
| 352 | + if($conf['amavis']['installed'] == true && $inst->reconfigure_app('Amavisd', $reconfigure_services_answer)) { |
346 | 353 | swriteln('Configuring Amavisd'); |
347 | 354 | $inst->configure_amavis(); |
348 | 355 | } |
349 | 356 |
|
350 | 357 | //** Configure Getmail |
351 | | - swriteln('Configuring Getmail'); |
352 | | - $inst->configure_getmail(); |
353 | | - } |
354 | | - |
355 | | - if($conf['services']['web'] && $conf['pureftpd']['installed'] == true) { |
356 | | - //** Configure Pureftpd |
357 | | - swriteln('Configuring Pureftpd'); |
358 | | - $inst->configure_pureftpd(); |
| 358 | + if ($inst->reconfigure_app('Getmail', $reconfigure_services_answer)) { |
| 359 | + swriteln('Configuring Getmail'); |
| 360 | + $inst->configure_getmail(); |
| 361 | + } |
359 | 362 | } |
360 | 363 |
|
361 | | - if($conf['services']['dns']) { |
| 364 | + if($conf['services']['dns'] && $inst->reconfigure_app('DNS', $reconfigure_services_answer)) { |
362 | 365 | //* Configure DNS |
363 | 366 | if($conf['powerdns']['installed'] == true) { |
364 | 367 | swriteln('Configuring PowerDNS'); |
|
373 | 376 | } |
374 | 377 |
|
375 | 378 | if($conf['services']['web']) { |
376 | | - if($conf['webserver']['server_type'] == 'apache'){ |
377 | | - //** Configure Apache |
378 | | - swriteln('Configuring Apache'); |
379 | | - $inst->configure_apache(); |
380 | | - |
381 | | - //** Configure vlogger |
382 | | - swriteln('Configuring vlogger'); |
383 | | - $inst->configure_vlogger(); |
384 | | - } else { |
385 | | - //** Configure nginx |
386 | | - swriteln('Configuring nginx'); |
387 | | - $inst->configure_nginx(); |
| 379 | + |
| 380 | + if($conf['pureftpd']['installed'] == true && $inst->reconfigure_app('Pureftpd', $reconfigure_services_answer)) { |
| 381 | + //** Configure Pureftpd |
| 382 | + swriteln('Configuring Pureftpd'); |
| 383 | + $inst->configure_pureftpd(); |
388 | 384 | } |
389 | 385 |
|
390 | | - //** Configure apps vhost |
391 | | - swriteln('Configuring Apps vhost'); |
392 | | - $inst->configure_apps_vhost(); |
393 | | - } |
| 386 | + if($inst->reconfigure_app('Web-Server', $reconfigure_services_answer)) { |
| 387 | + if($conf['webserver']['server_type'] == 'apache'){ |
| 388 | + //** Configure Apache |
| 389 | + swriteln('Configuring Apache'); |
| 390 | + $inst->configure_apache(); |
| 391 | + |
| 392 | + //** Configure vlogger |
| 393 | + swriteln('Configuring vlogger'); |
| 394 | + $inst->configure_vlogger(); |
| 395 | + } else { |
| 396 | + //** Configure nginx |
| 397 | + swriteln('Configuring nginx'); |
| 398 | + $inst->configure_nginx(); |
| 399 | + } |
| 400 | + |
| 401 | + //** Configure apps vhost |
| 402 | + swriteln('Configuring Apps vhost'); |
| 403 | + $inst->configure_apps_vhost(); |
| 404 | + } |
| 405 | + } |
394 | 406 |
|
395 | | - if($conf['services']['xmpp']) { |
| 407 | + if($conf['services']['xmpp'] && $inst->reconfigure_app('XMPP', $reconfigure_services_answer)) { |
396 | 408 | //** Configure Metronome XMPP |
397 | 409 | $inst->configure_xmpp('dont-create-certs'); |
398 | 410 | } |
399 | 411 |
|
400 | | - |
401 | | - //* Configure DBServer |
402 | | - swriteln('Configuring Database'); |
403 | | - $inst->configure_dbserver(); |
404 | | - |
405 | | - |
406 | | - if($conf['services']['firewall']) { |
| 412 | + if($conf['services']['firewall'] && $inst->reconfigure_app('Firewall', $reconfigure_services_answer)) { |
407 | 413 | if($conf['ufw']['installed'] == true) { |
408 | 414 | //* Configure Ubuntu Firewall |
409 | 415 | $conf['services']['firewall'] = true; |
|
416 | 422 | } |
417 | 423 | } |
418 | 424 |
|
| 425 | + //* Configure DBServer |
| 426 | + swriteln('Configuring Database'); |
| 427 | + $inst->configure_dbserver(); |
| 428 | + |
419 | 429 | /* |
420 | 430 | if($conf['squid']['installed'] == true) { |
421 | 431 | swriteln('Configuring Squid'); |
|
0 commit comments