Annotation of embedaddon/strongswan/testing/hosts/default/usr/local/bin/systemctl, revision 1.1.1.1
1.1 misho 1: #!/bin/bash
2: #
3: # LEAK_DETECTIVE_LOG is set for automated runs, however, this is not passed
4: # to a process started via systemctl. This wrapper is used to set the variable
5: # for the strongswan.service unit.
6:
7: ORIG=/bin/systemctl
8: CONF=/lib/systemd/system/strongswan.service
9:
10: if [[ "$2" != "strongswan" ]]; then
11: $ORIG "$@"
12: fi
13:
14: if [[ "$1" == "start" && -n $LEAK_DETECTIVE_LOG ]]; then
15: sed -i "s:Type=:Environment=LEAK_DETECTIVE_LOG=$LEAK_DETECTIVE_LOG\nType=:" $CONF 2>/dev/null
16: fi
17:
18: $ORIG "$@"
19:
20: if [[ "$1" == "stop" ]]; then
21: sed -i '/LEAK_DETECTIVE_LOG/d' $CONF 2>/dev/null
22: fi
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>