]>
Commit | Line | Data |
---|---|---|
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 | |
7 | ORIG=/bin/systemctl | |
35392aa8 | 8 | CONF=/lib/systemd/system/strongswan.service |
80c9ae45 | 9 | |
35392aa8 | 10 | if [[ "$2" != "strongswan" ]]; then |
80c9ae45 TB |
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 |