Disable bash debug (xtrace) by default, re-enable with -e DEBUG=1

This commit is contained in:
omriiluz 2015-02-28 02:45:31 -08:00
parent 42d95bd77a
commit e9d1022eb4
7 changed files with 32 additions and 6 deletions

View File

@ -39,6 +39,9 @@ Upstream links:
docker run --volumes-from $OVPN_DATA --rm kylemanna/openvpn ovpn_getclient CLIENTNAME > CLIENTNAME.ovpn docker run --volumes-from $OVPN_DATA --rm kylemanna/openvpn ovpn_getclient CLIENTNAME > CLIENTNAME.ovpn
* Create an environment variable with the name DEBUG and value of 1 to enable debug output (using "docker -e").
for example - docker run --volumes-from $OVPN_DATA -d -p 1194:1194/udp --privileged -e DEBUG=1 kylemanna/openvpn
## How Does It Work? ## How Does It Work?

View File

@ -4,7 +4,11 @@
# Import/export EasyRSA default settings # Import/export EasyRSA default settings
# #
set -ex if [ "$DEBUG" == "1" ]; then
set -x
fi
set -e
if [ $# -lt 1 ]; then if [ $# -lt 1 ]; then
echo "No command provided" echo "No command provided"

View File

@ -46,7 +46,11 @@ usage() {
echo " -m Set client MTU" echo " -m Set client MTU"
} }
set -ex if [ "$DEBUG" == "1" ]; then
set -x
fi
set -e
OVPN_ENV=$OPENVPN/ovpn_env.sh OVPN_ENV=$OPENVPN/ovpn_env.sh
OVPN_SERVER=192.168.255.0/24 OVPN_SERVER=192.168.255.0/24

View File

@ -4,7 +4,11 @@
# Get an OpenVPN client configuration file # Get an OpenVPN client configuration file
# #
set -ex if [ "$DEBUG" == "1" ]; then
set -x
fi
set -e
source "$OPENVPN/ovpn_env.sh" source "$OPENVPN/ovpn_env.sh"
cn=$1 cn=$1

View File

@ -4,7 +4,11 @@
# Initialize the EasyRSA PKI # Initialize the EasyRSA PKI
# #
set -ex if [ "$DEBUG" == "1" ]; then
set -x
fi
set -e
source "$OPENVPN/ovpn_env.sh" source "$OPENVPN/ovpn_env.sh"

View File

@ -4,7 +4,11 @@
# Run the OpenVPN server normally # Run the OpenVPN server normally
# #
set -ex if [ "$DEBUG" == "1" ]; then
set -x
fi
set -e
source "$OPENVPN/ovpn_env.sh" source "$OPENVPN/ovpn_env.sh"

View File

@ -3,7 +3,10 @@
# #
# Get OpenVPN server status # Get OpenVPN server status
# #
if [ "$DEBUG" == "1" ]; then
set -x
fi
set -ex set -e
tail -F /tmp/openvpn-status.log tail -F /tmp/openvpn-status.log