Commit 8c77ef51 authored by Matthew Smith's avatar Matthew Smith
Browse files

Change the outdir to run of a global variable, reuse the exiting yes

variable for the path
parent 888438a7
......@@ -142,6 +142,7 @@ OVPN_ORGNAME="$KEY_ORGANISATION"
OVPN_REMOTE="$SERVERADDR"
FIREWALLED=no
ALLOCATEIP=yes
CACHE_BUILDS="/var/lib/openvpn-server/openssl/builds/"
EOF
md5sum $TMPCONF/config.sh >$TMPCONF/config.sh.md5sum
......
......@@ -62,11 +62,11 @@ popd >/dev/null
dpkg-deb --build $WORKDIR ./$DEBFILE || exit
if [ "$CACHE_BUILDS" == "yes" ] ; then
mv ./$DEBFILE /var/lib/openvpn-server/openssl/builds/
echo "Your OpenVPN Debian client has been built in /var/lib/openvpn-server/openssl/client_setup/$DEBFILE"
else
if [ -z "$CACHE_BUILDS" ] ; then
echo "Your OpenVPN Debian client has been built $DEBFILE"
else
mv ./${DEBFILE} "${CACHE_BUILDS}/${DEBFILE}"
echo "Your OpenVPN Debian client has been built in ${CACHE_BUILDS}/$DEBFILE"
fi
rm -rf $WORKDIR
......
......@@ -60,11 +60,11 @@ popd >/dev/null
OVPNFILE="openvpn-${FILEBASE}.ovpn"
cp ${WORKDIR}/${FILEBASE}.ovpn ./$OVPNFILE
if [ "$CACHE_BUILDS" == "yes" ]; then
mv ${FILEBASE}.ovpn /var/lib/openvpn-server/openssl/builds/
echo "Your OpenVPN generic client has been built in /var/lib/openvpn-server/openssl/builds/${OVPNFILE}"
else
if [ -z "$CACHE_BUILDS" ]; then
echo "Your OpenVPN generic client has been built in ${OVPNFILE}"
else
mv ${FILEBASE}.ovpn "${CACHE_BUILDS}/${OVPNFILE}"
echo "Your OpenVPN generic client has been built in ${CACHE_BUILDS}/${OVPNFILE}"
fi
rm -rf $WORKDIR
......
......@@ -48,12 +48,12 @@ makensis -NOCD ./openvpn-deploy.nsi >/dev/null 2>&1
popd >/dev/null
if [ "$CACHE_BUILDS" == "yes" ]; then
mv $WORKDIR/sol1-openvpn-deploy.exe /var/lib/openvpn-server/openssl/builds/openvpn-${FILEBASE}.exe
echo "Your OpenVPN Windows client has been built in /var/lib/openvpn-server/openssl/builds/openvpn-${FILEBASE}.exe"
else
if [ -z "$CACHE_BUILDS" ]; then
mv $WORKDIR/sol1-openvpn-deploy.exe ./openvpn-${FILEBASE}.exe
echo "Your OpenVPN Windows client has been built in openvpn-${FILEBASE}.exe"
else
mv $WORKDIR/sol1-openvpn-deploy.exe "${CACHE_BUILDS}/openvpn-${FILEBASE}.exe"
echo "Your OpenVPN Windows client has been built in ${CACHE_BUILDS}/openvpn-${FILEBASE}.exe"
fi
rm -rf $WORKDIR
......
......@@ -78,7 +78,7 @@ if [ "$CACHEBUILD" = "y" ]
then
mkdir /var/lib/openvpn-server/openssl/builds
sed -i -e "/CACHE_BUILDS/d" /etc/openvpn-server/config.sh
echo "CACHE_BUILDS=yes" >> /etc/openvpn-server/config.sh
echo 'CACHE_BUILDS="/var/lib/openvpn-server/openssl/builds/"' >> /etc/openvpn-server/config.sh
echo "Builds will be moved to the ca-store - find them in
/var/lib/openvpn-server/openssl/builds (when mounted)"
else
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment