Skip to content

Commit

Permalink
added --user and --host parameters
Browse files Browse the repository at this point in the history
Support providing VPN target host and username via command line
parameters.
  • Loading branch information
MatthiasLohr committed Oct 11, 2018
1 parent 8bccc02 commit d637ba6
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions f5fpc-vpn.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

CONTAINER_NAME="f5fpc-vpn"
F5FPC_ARGS=""
VPNHOST=""
USERNAME=""
keep_running=1

for cmd in docker ip ; do
Expand All @@ -22,6 +24,8 @@ Supported modes:
Supported parameters:
-h --help Show this help text
-t --host VPN host
-u --user VPN username
EOF
}

Expand Down Expand Up @@ -80,6 +84,8 @@ start_client() {
docker run -d --rm --privileged \
--name "$CONTAINER_NAME" \
--net host \
-e VPNHOST="$VPNHOST" \
-e USERNAME="$USERNAME" \
matthiaslohr/f5fpc \
/opt/idle.sh > /dev/null
if [ "$?" != 0 ] ; then
Expand All @@ -94,6 +100,8 @@ start_gateway() {
docker run -d --rm --privileged \
--name "$CONTAINER_NAME" \
--sysctl net.ipv4.ip_forward=1 \
-e VPNHOST="$VPNHOST" \
-e USERNAME="$USERNAME" \
matthiaslohr/f5fpc \
/opt/idle.sh > /dev/null
if [ "$?" != 0 ] ; then
Expand Down Expand Up @@ -129,6 +137,16 @@ while [ $# -gt 0 ] ; do
exit
shift
;;
-t|--host)
VPNHOST="$2"
shift
shift
;;
-u|--user)
USERNAME="$2"
shift
shift
;;
-n|--network)
NETWORKS+=("$2")
shift
Expand Down

0 comments on commit d637ba6

Please sign in to comment.