Skip to content

Commit

Permalink
Make verbosity configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
loranmutafov committed Mar 8, 2023
1 parent d82405e commit 1722b69
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions bastion
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,23 @@ else
CONFIG_CLIENT_ALIVE_INTERVAL=""
fi

if [ -n "$TCP_KEEP_ALIVE" ]; then
CONFIG_TCP_KEEP_ALIVE="-o TCPKeepAlive=$TCP_KEEP_ALIVE"
if [ "$TCP_KEEP_ALIVE" = "false" ]; then
CONFIG_TCP_KEEP_ALIVE="-o TCPKeepAlive=no"
else
CONFIG_TCP_KEEP_ALIVE=""
CONFIG_TCP_KEEP_ALIVE="-o TCPKeepAlive=yes"
fi

# Verbosity from 0 to 3
if [ $VERBOSITY_LEVEL = "0" ]; then
CONFIG_VERBOSITY_LEVEL="-q"
elif [ $VERBOSITY_LEVEL = "1" ]; then
CONFIG_VERBOSITY_LEVEL="-v"
elif [ $VERBOSITY_LEVEL = "2" ]; then
CONFIG_VERBOSITY_LEVEL="-vv"
elif [ $VERBOSITY_LEVEL = "3" ]; then
CONFIG_VERBOSITY_LEVEL="-vvv"
else
CONFIG_VERBOSITY_LEVEL=""
fi

# Generate keys if they don't exist
Expand Down Expand Up @@ -114,5 +127,6 @@ fi
$CONFIG_CLIENT_ALIVE_COUNT_MAX \
$CONFIG_CLIENT_ALIVE_INTERVAL \
$CONFIG_TCP_KEEP_ALIVE \
$CONFIG_VERBOSITY_LEVEL \
$CONFIG_LISTEN_ADDRESS \
$CONFIG_LISTEN_PORT

0 comments on commit 1722b69

Please sign in to comment.