summaryrefslogtreecommitdiff
path: root/community/partimage/partimaged-gencrt
diff options
context:
space:
mode:
authorroot <root@rshg054.dnsready.net>2013-07-19 01:10:32 -0700
committerroot <root@rshg054.dnsready.net>2013-07-19 01:10:32 -0700
commit8fbc0076a4827ddc6af92e0b9daa4c4c31450808 (patch)
tree03fd0e2921ebd53228d9a93e32ed3976b636cbea /community/partimage/partimaged-gencrt
parente445a313723389ba9ee1fded025c567dae5b21ea (diff)
Fri Jul 19 01:09:18 PDT 2013
Diffstat (limited to 'community/partimage/partimaged-gencrt')
-rw-r--r--community/partimage/partimaged-gencrt18
1 files changed, 18 insertions, 0 deletions
diff --git a/community/partimage/partimaged-gencrt b/community/partimage/partimaged-gencrt
new file mode 100644
index 000000000..16fe5ff16
--- /dev/null
+++ b/community/partimage/partimaged-gencrt
@@ -0,0 +1,18 @@
+#!/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