File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / strongswan / testing / hosts / default / usr / local / bin / service
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Wed Jun 3 09:46:48 2020 UTC (5 years, 2 months ago) by misho
Branches: strongswan, MAIN
CVS tags: v5_9_2p0, v5_8_4p7, HEAD
Strongswan

#!/bin/bash
#
# LEAK_DETECTIVE_LOG is set for automated runs, however, `service` strips
# the environment. This wrapper is used to set the variable for the charon
# init script.

ORIG=/usr/sbin/service
CONF=/etc/default/charon

if [[ "$1" != "charon" ]]; then
	$ORIG "$@"
fi

if [[ "$2" == "start" && -n $LEAK_DETECTIVE_LOG ]]; then
	echo "export LEAK_DETECTIVE_LOG=$LEAK_DETECTIVE_LOG" >> $CONF
fi

$ORIG "$@"

if [[ "$2" == "stop" ]]; then
	sed -i '/LEAK_DETECTIVE_LOG/d' $CONF 2>/dev/null
fi

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>