Annotation of embedaddon/strongswan/testing/hosts/default/usr/local/bin/service, revision 1.1
1.1 ! misho 1: #!/bin/bash
! 2: #
! 3: # LEAK_DETECTIVE_LOG is set for automated runs, however, `service` strips
! 4: # the environment. This wrapper is used to set the variable for the charon
! 5: # init script.
! 6:
! 7: ORIG=/usr/sbin/service
! 8: CONF=/etc/default/charon
! 9:
! 10: if [[ "$1" != "charon" ]]; then
! 11: $ORIG "$@"
! 12: fi
! 13:
! 14: if [[ "$2" == "start" && -n $LEAK_DETECTIVE_LOG ]]; then
! 15: echo "export LEAK_DETECTIVE_LOG=$LEAK_DETECTIVE_LOG" >> $CONF
! 16: fi
! 17:
! 18: $ORIG "$@"
! 19:
! 20: if [[ "$2" == "stop" ]]; then
! 21: sed -i '/LEAK_DETECTIVE_LOG/d' $CONF 2>/dev/null
! 22: fi
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>