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

Include optional configuration options #28

Merged
merged 5 commits into from
Jan 18, 2015
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Support client mtu push
  • Loading branch information
omriiluz committed Jan 17, 2015
commit 1cb38ce14668079fcc447cb327495a953f0d8086
8 changes: 6 additions & 2 deletions bin/ovpn_genconfig
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ usage() {
echo " -c Enable client-to-client option"
echo " -D Disable built in external dns (google dns)"
echo " -N Configure NAT to access external server network"
echo " -m Set client MTU"
}

set -ex
Expand All @@ -59,7 +60,7 @@ OVPN_PUSH=()
[ -r "$OVPN_ENV" ] && source "$OVPN_ENV"

# Parse arguments
while getopts ":r:s:du:cp:DN" opt; do
while getopts ":r:s:du:cp:DNm:" opt; do
case $opt in
r)
OVPN_ROUTES+=("$OPTARG")
Expand All @@ -85,6 +86,9 @@ while getopts ":r:s:du:cp:DN" opt; do
N)
OVPN_NAT=1
;;
m)
OVPN_MTU=$OPTARG
;;
\?)
set +x
echo "Invalid option: -$OPTARG" >&2
Expand Down Expand Up @@ -120,7 +124,7 @@ fi

export OVPN_SERVER OVPN_ROUTES OVPN_DEFROUTE
export OVPN_SERVER_URL OVPN_ENV OVPN_PROTO OVPN_CN OVPN_PORT
export OVPN_CLIENT_TO_CLIENT OVPN_PUSH
export OVPN_CLIENT_TO_CLIENT OVPN_PUSH OVPN_NAT OVPN_DNS OVPN_MTU

# Preserve config
if [ -f "$OVPN_ENV" ]; then
Expand Down
2 changes: 2 additions & 0 deletions bin/ovpn_getclient
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,5 @@ EOF
if [ "$OVPN_DEFROUTE" != "0" ];then
echo "redirect-gateway def1"
fi

[ -n "$OVPN_MTU" ] && echo "tun-mtu $OVPN_MTU"