| 1 |
#!/bin/sh |
| 2 |
|
| 3 |
set -e |
| 4 |
|
| 5 |
[ ! "$1" = "configure" ] && exit 0 |
| 6 |
|
| 7 |
opensslpath=/usr/bin/openssl |
| 8 |
|
| 9 |
# SSL Certs |
| 10 |
if [ -s "/etc/partimaged/partimaged.key" ]; then |
| 11 |
echo "OpenSSL certificate already exists. Leaving..." |
| 12 |
else |
| 13 |
if [ ! -s "/etc/partimaged/partimage-certs.cnf" ]; then |
| 14 |
echo "I cannot find the /etc/partimaged/partimage-certs.cnf file." |
| 15 |
echo "SSL certificate will not be created!" |
| 16 |
else |
| 17 |
echo "Creating certificates for partimage-server" |
| 18 |
# tmpfiles.d will fix the permissions |
| 19 |
mkdir -p /etc/partimaged |
| 20 |
$opensslpath req -new -x509 -nodes -config \ |
| 21 |
/etc/partimaged/partimage-certs.cnf \ |
| 22 |
-out /etc/partimaged/partimaged.cert -keyout \ |
| 23 |
/etc/partimaged/partimaged.key |
| 24 |
rm -f /etc/partimaged/partimaged.csr |
| 25 |
fi |
| 26 |
fi |
| 27 |
|
| 28 |
if dpkg --compare-versions "$2" lt-nl "0.6.9-10~"; then |
| 29 |
update-rc.d -f partimaged remove || true |
| 30 |
fi |
| 31 |
|
| 32 |
#DEBHELPER# |
| 33 |
|