Skip to content

Commit

Permalink
Merge pull request #48 from ypid/optimized-copy-server-script
Browse files Browse the repository at this point in the history
Optimized ovpn_copy_server_files script. No need to copy the config files.
  • Loading branch information
kylemanna committed May 30, 2015
2 parents a52a9cd + e361e75 commit e0f7856
Showing 1 changed file with 9 additions and 12 deletions.
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"

0 comments on commit e0f7856

Please sign in to comment.