[3/3] IPsec: Log the content of all PLUTO variables in debug mode

Message ID 1519383935-3556-3-git-send-email-jonatan.schlag@ipfire.org
State Accepted
Commit 93a9eeb0e4a6db467f301a87e1430c8d3f581998
Headers
Series [1/3] Add new function: device_get_by_assigned_ip_address() |

Commit Message

Jonatan Schlag via network Feb. 23, 2018, 10:05 p.m. UTC
  Signed-off-by: Jonatan Schlag <jonatan.schlag@ipfire.org>
---
 src/helpers/ipsec-updown | 7 +++++++
 1 file changed, 7 insertions(+)
  

Comments

Jonatan Schlag via network Feb. 24, 2018, 10:54 p.m. UTC | #1
*thumbs up*

On Fri, 2018-02-23 at 11:05 +0000, Jonatan Schlag via network wrote:
> Signed-off-by: Jonatan Schlag <jonatan.schlag@ipfire.org>
> ---
>  src/helpers/ipsec-updown | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/src/helpers/ipsec-updown b/src/helpers/ipsec-updown
> index e4d704d..12ead03 100644
> --- a/src/helpers/ipsec-updown
> +++ b/src/helpers/ipsec-updown
> @@ -29,6 +29,13 @@ network_settings_read
>  # Make sure we are called by strongSwan
>  assert isset PLUTO_VERSION
>  
> +if enabled DEBUG; then
> +	while read line; do
> +		[[ ${line} =~ ^PLUTO_ ]] || continue
> +		log DEBUG "  ${line}"
> +	done <<< "$(printenv | sort)"
> +fi
> +
>  CONNECTION="${PLUTO_CONNECTION}"
>  
>  if ! ipsec_connection_read_config "${CONNECTION}"; then
  

Patch

diff --git a/src/helpers/ipsec-updown b/src/helpers/ipsec-updown
index e4d704d..12ead03 100644
--- a/src/helpers/ipsec-updown
+++ b/src/helpers/ipsec-updown
@@ -29,6 +29,13 @@  network_settings_read
 # Make sure we are called by strongSwan
 assert isset PLUTO_VERSION
 
+if enabled DEBUG; then
+	while read line; do
+		[[ ${line} =~ ^PLUTO_ ]] || continue
+		log DEBUG "  ${line}"
+	done <<< "$(printenv | sort)"
+fi
+
 CONNECTION="${PLUTO_CONNECTION}"
 
 if ! ipsec_connection_read_config "${CONNECTION}"; then