diff --git a/shellpki.sh b/shellpki.sh index 62fba37..39a6f81 100755 --- a/shellpki.sh +++ b/shellpki.sh @@ -96,8 +96,34 @@ chown -R root:www $WWWDIR chmod -R u=rwX,g=rwX,o= $WWWDIR echo -} +# generate client configuration +if [ -e $PREFIX/template.conf ]; then + + CA=/etc/openvpn/ssl/ca/cacert.pem + CERT=/var/www/htdocs/vpn/ssl/$cn.crt + KEY=/var/www/htdocs/vpn/ssl/$cn.key + REP=/tmp + + cp $PREFIX/template.conf $REP/$cn.conf +echo " + + +$(cat $CA) + + + +$(cat $CERT) + + + +$(cat $KEY) + +" >> $REP/$cn.conf + + echo "The configuration file is available in $REP/$cn.conf" +fi +} revoke() { echo "Please enter CN (Common Name) to revoke" @@ -187,7 +213,7 @@ case "$1" in revoke) revoke ;; - + crl) crl ;;