diff --git a/bin/entrypoint b/bin/entrypoint index a6f20e8..6dcc1d0 100644 --- a/bin/entrypoint +++ b/bin/entrypoint @@ -8,6 +8,8 @@ ENABLE_NAT=${ENABLE_NAT:-1} NAT_SOURCE=${NAT_SOURCE:-10.8.0.0/24} NAT_DEVICE=${NAT_DEVICE:-eth0} +DEBUG=${DEBUG:-0} + # Create device for tun interfaces mkdir -p /dev/net if [ ! -c /dev/net/tun ]; then @@ -24,4 +26,9 @@ if [[ -e ${USER_STARTUP_SCRIPT} ]]; then ${USER_STARTUP_SCRIPT} fi +# Redirect output to /dev/null unless in debug mode +if [[ $DEBUG = 0 ]]; then + exec &>/dev/null +fi + exec openvpn --config ${CONFIG_DIR}/openvpn.conf --cd ${CONFIG_DIR} $@