You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
1.3 KiB
48 lines
1.3 KiB
9 years ago
|
#!/bin/sh
|
||
|
|
||
9 years ago
|
# New cert
|
||
|
DOM=${1}
|
||
|
KEY=${2}
|
||
|
CRT=${3}
|
||
9 years ago
|
CHAIN=${5}
|
||
9 years ago
|
|
||
9 years ago
|
if [ -z "$DOM" -o -z "$KEY" -o -z "$CRT" -o -z "$CHAIN" ]; then
|
||
9 years ago
|
echo "Usage: $0 domain /path/to/key /path/to/cert /path/to/chain" >&2
|
||
|
exit 1
|
||
|
fi
|
||
|
|
||
|
if [ \! -e "$KEY" ]; then
|
||
|
echo "Can't use $KEY as key (file doesn't exist)" >&2
|
||
|
exit 1
|
||
|
fi
|
||
|
if [ \! -e "$CRT" ]; then
|
||
|
echo "Can't use $CRT as certificate (file doesn't exist)" >&2
|
||
|
exit 1
|
||
|
fi
|
||
|
if [ \! -e "$CHAIN" ]; then
|
||
|
echo "Can't use $chain as certificate chain (file doesn't exist)" >&2
|
||
|
exit 1
|
||
|
fi
|
||
|
|
||
9 years ago
|
/sbin/e-smith/db configuration setprop modSSL key $KEY crt $CRT CertificateChainFile $CHAIN
|
||
|
# There's a new ssl-udpate event which update everything in a single event
|
||
|
# fallback to manual operations if this event doesn't exist
|
||
|
if [ -d /etc/e-smith/events/ssl-update ]; then
|
||
|
/sbin/e-smith/signal-event ssl-update
|
||
|
else
|
||
9 years ago
|
/sbin/e-smith/expand-template /home/e-smith/ssl.pem/pem
|
||
9 years ago
|
/sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf
|
||
|
/sbin/e-smith/expand-template /var/service/qpsmtpd/ssl/cert.pem
|
||
|
/usr/bin/sv 1 /service/httpd-e-smith
|
||
|
/usr/bin/sv h /service/ldap
|
||
|
/usr/bin/sv 1 /service/pop3s
|
||
|
/usr/bin/sv h /service/qpsmtpd
|
||
|
/usr/bin/sv h /service/sqpsmtpd
|
||
|
if [ -d /service/dovecot ]; then
|
||
|
/usr/bin/sv 1 /service/dovecot
|
||
|
/usr/bin/sv h /service/dovecot
|
||
9 years ago
|
else
|
||
9 years ago
|
/usr/bin/sv 1 /service/imaps
|
||
9 years ago
|
fi
|
||
|
fi
|