Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions helpers/run.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/bin/sh

dest=${dest:-docker.ovpn}
network=${DOCKER_NETWORK:-172.16.0.0}
netmask=${DOCKER_NETMASK:-255.240.0.0}

if [ ! -f "/local/$dest" ]; then
echo "*** REGENERATING ALL CONFIGS ***"
Expand All @@ -10,10 +12,7 @@ if [ ! -f "/local/$dest" ]; then
sed -i 's|^push|#push|' /etc/openvpn/openvpn.conf
echo localhost | ovpn_initpki nopass
easyrsa build-client-full host nopass
ovpn_getclient host | sed '
s|localhost 1194|localhost 13194|;
s|redirect-gateway.*|route 172.16.0.0 255.240.0.0|;
' > "/local/$dest"
ovpn_getclient host | sed "s|localhost 1194|localhost 13194|;s|redirect-gateway.*|route ${network} ${netmask}|;" > "/local/$dest"
fi

exec ovpn_run