openvpn.sh: Split in to smaller scripts

* Split soon to be massive wrapper into smaller managable scripts.
* Re-organized Dockerfile to exploit cache when rebuilding
This commit is contained in:
Kyle Manna
2014-06-04 11:13:59 -07:00
parent 035ff64200
commit 1869cd85d0
7 changed files with 169 additions and 156 deletions

35
bin/easyrsa_vars Executable file
View File

@ -0,0 +1,35 @@
#!/bin/sh
#
# Import/export EasyRSA default settings
#
set -ex
if [ $# -lt 1 ]; then
echo "No command provided"
echo
echo "$0 export > /path/to/file"
echo "$0 import < /path/to/file"
exit 1
fi
cmd=$1
shift
case "$cmd" in
export)
if [ -f "$EASYRSA_VARS_FILE" ]; then
cat "$EASYRSA_VARS_FILE"
else
cat "$EASYRSA/vars.example"
fi
;;
import)
cat > "$EASYRSA_VARS_FILE"
;;
*)
echo "Unknown cmd \"$cmd\""
exit 2
;;
esac