--- smeserver-ocsinventory-0.1/createlinks.cert_change 2009-03-19 12:07:00.000000000 +0100 +++ smeserver-ocsinventory-0.1/createlinks 2009-03-25 13:49:31.000000000 +0100 @@ -4,12 +4,15 @@ my $event = 'ocs-update'; -templates2events("/etc/httpd/conf/httpd.conf", qw(ocs-update)); +templates2events("/etc/httpd/conf/httpd.conf", $event); templates2events("/etc/my.cnf", $event); templates2events("/etc/ocsinventory/ocsinventory-reports/dbconfig.inc.php", qw(ocs-update bootstrap-console-save)); templates2events("/etc/e-smith/sql/init/80ocs_mysql.sql", $event); event_link("ocs-conf", $event, "10"); +event_link("ocs-conf", "domain-modify", "10"); +event_link("ocs-conf", "bootstrap-console-save", "10"); + safe_symlink("start", "root/etc/e-smith/events/$event/services2adjust/mysql.init"); safe_symlink("sigusr1", "root/etc/e-smith/events/$event/services2adjust/httpd-e-smith"); safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/mysqld"); --- smeserver-ocsinventory-0.1/root/etc/e-smith/events/actions/ocs-conf.cert_change 2009-03-25 13:41:52.000000000 +0100 +++ smeserver-ocsinventory-0.1/root/etc/e-smith/events/actions/ocs-conf 2009-03-25 13:47:34.000000000 +0100 @@ -9,8 +9,15 @@ SRVNAME=$(/sbin/e-smith/db configuration get SystemName) # Copying SME's certificate into cacert.pem if the file do not exist # This file is used by deployment function + if [ ! -e /home/e-smith/ssl.crt/cacert.pem ]; then cp /home/e-smith/ssl.crt/$SRVNAME.$DOMAIN.crt /home/e-smith/ssl.crt/cacert.pem +else + CACERTMD5=$(md5sum /home/e-smith/ssl.crt/cacert.pem) + SMECERTMD5=$(md5sum /home/e-smith/ssl.crt/$SRVNAME.$DOMAIN.crt) + if [ "$CACERTMD5" != "$SMECERTMD5" ]; then + # Certificate has changed, update cacert.pem + cat /home/e-smith/ssl.crt/$SRVNAME.$DOMAIN.crt > /home/e-smith/ssl.crt/cacert.pem + fi fi -