openvpn.sh: Add wrapper script

* Add the beginning of a wrapper script that will handle cert generation
  and OpenVPN invocation.
This commit is contained in:
Kyle Manna 2014-06-03 20:54:47 -07:00
parent 47bc4e4865
commit 023cfe6596
2 changed files with 31 additions and 1 deletions

View File

@ -5,7 +5,12 @@ FROM ubuntu:14.04
MAINTAINER Kyle Manna <kyle@kylemanna.com> MAINTAINER Kyle Manna <kyle@kylemanna.com>
RUN apt-get install -y openvpn iptables curl RUN apt-get install -y openvpn iptables curl
ADD ./bin /usr/local/sbin ADD ./bin /usr/local/sbin
RUN chmod a+x /usr/local/sbin/*
VOLUME /etc/openvpn VOLUME /etc/openvpn
EXPOSE 443/tcp 1194/udp 8080/tcp EXPOSE 443/tcp 1194/udp 8080/tcp
CMD run
ENTRYPOINT ["openvpn.sh"]

25
bin/openvpn.sh Executable file
View File

@ -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