Optimized ovpn_copy_server_files script. No need to copy the config files.

* rsync can copy the actual files.
* This change makes it easier to modifier the configuration and sync it
  to the server. You only have to execute the ovpn_copy_server_files
  once.
This commit is contained in:
Robin Schneider 2015-05-31 00:45:16 +02:00
parent 5e4bad7bc4
commit e361e757da
No known key found for this signature in database
GPG Key ID: 489A4D5EC353C98A

View File

@ -17,18 +17,15 @@ else
TARGET="$OPENVPN/server" TARGET="$OPENVPN/server"
fi fi
rsync --recursive --verbose --prune-empty-dirs \ echo "
--exclude="clients" \ pki/private/${OVPN_CN}.key
--exclude="server" \ pki/issued/${OVPN_CN}.crt
--include "*/" \ pki/dh.pem
--include "/pki/private/${OVPN_CN}.key" \ pki/ta.key
--include "/pki/ca.crt" \ pki/ca.crt
--include "/pki/issued/${OVPN_CN}.crt" \ " | rsync --recursive --verbose \
--include "/pki/dh.pem" \ --files-from - \
--include "ta.key" \
--include "/openvpn.conf" \
--include "/ovpn_env.sh" \
--exclude="*" \
"$OPENVPN/" "$TARGET" "$OPENVPN/" "$TARGET"
ln --symbolic --force ../openvpn.conf ../ovpn_env.sh "$TARGET"
echo "Created the openvpn configuration for the server: $TARGET" echo "Created the openvpn configuration for the server: $TARGET"