55 lines
1.4 KiB
Plaintext
55 lines
1.4 KiB
Plaintext
|
{
|
||
|
use strict;
|
||
|
use warnings;
|
||
|
use esmith::ConfigDB;
|
||
|
|
||
|
my $configDB = esmith::ConfigDB->open_ro or die("can't open Config DB");
|
||
|
|
||
|
my $letsencryptStatus = $configDB->get_prop( 'letsencrypt', 'status' ) || 'disabled';
|
||
|
|
||
|
my $version = $configDB->get_prop( 'sysconfig', 'ReleaseVersion' );
|
||
|
|
||
|
$version = substr( $version, 0, 1 );
|
||
|
|
||
|
if ( $letsencryptStatus ne 'disabled' ) {
|
||
|
|
||
|
if ( $version == 8 ) {
|
||
|
$OUT .= <<'_EOF';
|
||
|
|
||
|
if [ $1 = "deploy_cert" ]; then
|
||
|
KEY=$3
|
||
|
CERT=$4
|
||
|
CHAIN=$6
|
||
|
echo "Set up modSSL db keys"
|
||
|
/sbin/e-smith/db configuration setprop modSSL key $KEY
|
||
|
/sbin/e-smith/db configuration setprop modSSL crt $CERT
|
||
|
/sbin/e-smith/db configuration setprop modSSL CertificateChainFile $CHAIN
|
||
|
echo "Signal events"
|
||
|
/sbin/e-smith/signal-event domain-modify
|
||
|
/sbin/e-smith/signal-event email-update
|
||
|
/sbin/e-smith/signal-event ibay-modify
|
||
|
echo "All complete"
|
||
|
fi
|
||
|
_EOF
|
||
|
}
|
||
|
else {
|
||
|
|
||
|
$OUT .= <<'_EOF';
|
||
|
|
||
|
if [ $1 = "deploy_cert" ]; then
|
||
|
KEY=$3
|
||
|
CERT=$4
|
||
|
CHAIN=$6
|
||
|
echo "Set up modSSL db keys"
|
||
|
/sbin/e-smith/db configuration setprop modSSL key $KEY
|
||
|
/sbin/e-smith/db configuration setprop modSSL crt $CERT
|
||
|
/sbin/e-smith/db configuration setprop modSSL CertificateChainFile $CHAIN
|
||
|
echo "Signal events"
|
||
|
/sbin/e-smith/signal-event ssl-update
|
||
|
echo "All complete"
|
||
|
fi
|
||
|
_EOF
|
||
|
}
|
||
|
}
|
||
|
}
|