Parameterize the BASE_DIR in the mkopenvpn.sh script
Change-Id: I701bd6a96d32d4bcf2d190be09e5d4f74af48f65
diff --git a/mkopenvpn.sh b/mkopenvpn.sh
index 3c0a04d..b53a939 100755
--- a/mkopenvpn.sh
+++ b/mkopenvpn.sh
@@ -6,6 +6,9 @@
VPN_SITE=${VPN_SITE:-example}
+# where PKI is generated are kept, same variable as Makefile
+export BASE_DIR=${BASE_DIR:-onf_pki}
+
export IM_CA_NAME=openvpn_ca
export LEAF_PURPOSE=client_cert_ext
@@ -13,7 +16,7 @@
export LEAF_EMAIL=${LEAF_EMAIL:-"${VPN_USER}@opennetworking.org"}
export LEAF_SAN="email:${LEAF_EMAIL}"
-make onf_pki/certout/${VPN_USER}.pem
+make ${BASE_DIR}/certout/${VPN_USER}.pem
# build config
VPN_CONFIG=openvpn/${VPN_USER}_${VPN_SITE}.ovpn
@@ -26,7 +29,7 @@
EOKEY
# add key
-cat onf_pki/certout/${VPN_USER}.key >> $VPN_CONFIG
+cat ${BASE_DIR}/certout/${VPN_USER}.key >> $VPN_CONFIG
cat << EOCERT >> $VPN_CONFIG
</key>
@@ -36,7 +39,7 @@
EOCERT
# add pem
-cat onf_pki/certout/${VPN_USER}.pem >> $VPN_CONFIG
+cat ${BASE_DIR}/certout/${VPN_USER}.pem >> $VPN_CONFIG
cat << EOF >> $VPN_CONFIG
</cert>