X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-vnc-server.git/blobdiff_plain/115d1b8e6398ba73ce5793074f78d8f0b129c483..fb40a4a5cc90d713c0e62dc6e7b168f8db18f6e7:/debian/invirt-vnc-server.postinst diff --git a/debian/invirt-vnc-server.postinst b/debian/invirt-vnc-server.postinst index ee266d9..12f3616 100755 --- a/debian/invirt-vnc-server.postinst +++ b/debian/invirt-vnc-server.postinst @@ -20,10 +20,16 @@ set -e case "$1" in configure) - if [ -z "$2" ]; then - echo "Please be sure to copy vncproxy.crt and vncproxykey.pem into /usr/share/invirt-vnc-server/" - fi mkdir -p /etc/invirt/secrets + if ! [ -e /etc/invirt/secrets/vnc.pem ]; then + openssl genrsa -out /etc/invirt/secrets/vnc.pem 1024 >/dev/null + fi + + if ! [ -e /etc/invirt/secrets/vnc.crt ]; then + openssl req -new -x509 -nodes -sha1 -subj '/' -key /etc/invirt/secrets/vnc.pem \ + > /etc/invirt/secrets/vnc.crt + fi + if ! [ -e /etc/invirt/secrets/vnc-key ]; then openssl rand -base64 33 >/etc/invirt/secrets/vnc-key fi