mirror of
https://github.com/archlinuxarm/PKGBUILDs.git
synced 2024-12-08 23:03:46 +00:00
18 lines
534 B
Bash
18 lines
534 B
Bash
#!/bin/sh
|
|
|
|
if [ `whoami` != "root" ]; then
|
|
echo "You must be root to generate certificates."
|
|
exit
|
|
fi
|
|
|
|
echo -n "==> Generating certificate for Partimage/PartimageD SSL... "
|
|
cd /etc/partimaged
|
|
openssl req -new -x509 -outform PEM > partimaged.csr
|
|
openssl rsa -in privkey.pem -out partimaged.key
|
|
rm privkey.pem
|
|
openssl x509 -in partimaged.csr -out partimaged.cert -signkey partimaged.key
|
|
rm partimaged.csr
|
|
chmod 600 partimaged.key
|
|
chmod 600 partimaged.cert
|
|
chown partimag:partimag partimaged.key
|
|
chown partimag:partimag partimaged.cert
|