From d80a9876d2256f15d5db271012d1392e551b7d1b Mon Sep 17 00:00:00 2001 From: Tristan Pilat Date: Fri, 5 Dec 2014 16:28:56 +0100 Subject: [PATCH] Generation conf inline --- shellpki.sh | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) 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 ;;