Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
May 30, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Optimized ovpn_copy_server_files script. No need to copy the config f…
…iles.

* 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.
  • Loading branch information
ypid committed May 30, 2015
commit e361e757da5720337bb1d8ccf06e570ade629cce
21 changes: 9 additions & 12 deletions bin/ovpn_copy_server_files
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,15 @@ else
TARGET="$OPENVPN/server"
fi

rsync --recursive --verbose --prune-empty-dirs \
--exclude="clients" \
--exclude="server" \
--include "*/" \
--include "/pki/private/${OVPN_CN}.key" \
--include "/pki/ca.crt" \
--include "/pki/issued/${OVPN_CN}.crt" \
--include "/pki/dh.pem" \
--include "ta.key" \
--include "/openvpn.conf" \
--include "/ovpn_env.sh" \
--exclude="*" \
echo "
pki/private/${OVPN_CN}.key
pki/issued/${OVPN_CN}.crt
pki/dh.pem
pki/ta.key
pki/ca.crt
" | rsync --recursive --verbose \
--files-from - \
"$OPENVPN/" "$TARGET"
ln --symbolic --force ../openvpn.conf ../ovpn_env.sh "$TARGET"

echo "Created the openvpn configuration for the server: $TARGET"