4 function called by a sysadmin when (s)he want to reload all
5 certificate configured for all subdomains, including system services.
7 /usr/lib/alternc/reload-certs <enter>
8 system services WILL BE RELOADED
12 require_once("/usr/share/alternc/panel/class/config_nochk.php");
15 echo "OUPS: reload-certs launched, but ssl module not installed, exiting\n";
19 if (posix_getuid()!=0) {
20 echo "This script MUST be launched as root, it should be able to overwrite files in /etc/ssl/private\n";
24 // force reloading all valid certificates in the proper vhosts :
25 variable_set('last_certificate_id',0);
27 $ssl->cron_new_certs();
29 // forcibly reload all services (new certificates may apply)
30 $services=array("postfix","dovecot","proftpd","apache2");
32 foreach($services as $service) {
33 passthru("service $service status",$ret);
35 echo "$service not running, restarting\n";
36 passthru("service $service restart");
39 echo "$service running, reloading\n";
40 passthru("service $service reload");