2
0
mirror of https://github.com/vimagick/dockerfiles.git synced 2025-12-21 13:23:02 +01:00
This commit is contained in:
kev
2015-07-06 08:35:53 +08:00
parent 6b5e3626b5
commit c114b2ac29
3 changed files with 103 additions and 0 deletions

30
openvpn/setup.sh Executable file
View File

@@ -0,0 +1,30 @@
#!/bin/bash
#
# setup script for kylemanna/openvpn
#
OVPN_DATA=${OVPN_DATA:-openvpn_data_1}
OVPN_SERVER=${OVPN_SERVER:-tcp://vpn.datageek.info}
OVPN_CLIENT=${OVPN_CLIENT:-client}
select opt in server client quit
do
if [[ $opt == "server" ]]
then
echo "setup server ..."
docker run --volumes-from $OVPN_DATA --rm kylemanna/openvpn ovpn_genconfig -c -u $OVPN_SERVER
docker run --volumes-from $OVPN_DATA --rm -it kylemanna/openvpn ovpn_initpki
elif [[ $opt == "client" ]]
then
echo "setup client ..."
docker run --volumes-from $OVPN_DATA --rm -it kylemanna/openvpn easyrsa build-client-full $OVPN_CLIENT nopass
docker run --volumes-from $OVPN_DATA --rm kylemanna/openvpn ovpn_getclient $OVPN_CLIENT > $OVPN_CLIENT.ovpn
elif [[ $opt == "quit" ]]
then
echo "bye"
exit
else
echo "invalid"
fi
done