#!/usr/bin/bash

if [ $# -eq 1 ] ; then
    mkdir ../$1 2> /dev/null
    chown apache ../$1
    chmod 700 ../$1
    cp $1.pubkey.pem ../$1/pubkey.pem
    # do NOT change ownnership of the public key to apache, because the public key 
    # must only be readable for the webserver UID
    # if pubkey.pem is writable for root only no rogue webserver code can overwrite it.
    ls -l ../$1
    echo "done".
fi
