From 023cfe6596d16ae91cf3ce8ca3fbedc3a242e215 Mon Sep 17 00:00:00 2001 From: Kyle Manna Date: Tue, 3 Jun 2014 20:54:47 -0700 Subject: [PATCH] openvpn.sh: Add wrapper script * Add the beginning of a wrapper script that will handle cert generation and OpenVPN invocation. --- Dockerfile | 7 ++++++- bin/openvpn.sh | 25 +++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100755 bin/openvpn.sh diff --git a/Dockerfile b/Dockerfile index 44f1c6f..e130967 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,12 @@ FROM ubuntu:14.04 MAINTAINER Kyle Manna RUN apt-get install -y openvpn iptables curl + ADD ./bin /usr/local/sbin +RUN chmod a+x /usr/local/sbin/* + VOLUME /etc/openvpn + EXPOSE 443/tcp 1194/udp 8080/tcp -CMD run + +ENTRYPOINT ["openvpn.sh"] diff --git a/bin/openvpn.sh b/bin/openvpn.sh new file mode 100755 index 0000000..00efc39 --- /dev/null +++ b/bin/openvpn.sh @@ -0,0 +1,25 @@ +#!/bin/bash +# +# OpenVPN + Docker Wrapper Script +# + +set -ex + +abort() { + echo "Error: $@" + exit 1 +} + +if [ $# -lt 1 ]; then + abort "No command specified" +fi + +# Read arguments from command line +cmd=$1 +shift + +case "$cmd" in + *) + abort "Unknown cmd \"$cmd\"" + ;; +esac