]> git.ipfire.org Git - thirdparty/strongswan.git/blame - testing/hosts/default/usr/local/bin/systemctl
testing: Use renamed systemd unit
[thirdparty/strongswan.git] / testing / hosts / default / usr / local / bin / systemctl
CommitLineData
80c9ae45
TB
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
35392aa8 5# for the strongswan.service unit.
80c9ae45
TB
6
7ORIG=/bin/systemctl
35392aa8 8CONF=/lib/systemd/system/strongswan.service
80c9ae45 9
35392aa8 10if [[ "$2" != "strongswan" ]]; then
80c9ae45
TB
11 $ORIG "$@"
12fi
13
14if [[ "$1" == "start" && -n $LEAK_DETECTIVE_LOG ]]; then
15 sed -i "s:Type=:Environment=LEAK_DETECTIVE_LOG=$LEAK_DETECTIVE_LOG\nType=:" $CONF 2>/dev/null
16fi
17
18$ORIG "$@"
19
20if [[ "$1" == "stop" ]]; then
21 sed -i '/LEAK_DETECTIVE_LOG/d' $CONF 2>/dev/null
22fi