#!/bin/sh
if [ -r ../game/data/server.pem ]; then 
 echo "Will not overwrite game/data/server.pem"
 echo "Remove that file and do 'makecert' again"
 echo "to create a new certificate."
 echo
else
 openssl rand -rand /etc/hosts:/etc/passwd 0; \
 echo "Creating secure certificate. Please answer all the questions.";
 echo "The key and certificate will be stored in the game/data/server.pem file.";
 echo;
 openssl req -x509 -nodes -out ../game/data/server.pem -keyout ../game/data/server.pem -config protomuck.cnf -new -days 730;
fi
