mirror of
https://github.com/strongswan/strongswan.git
synced 2025-10-06 00:00:47 -04:00
While the alias is available after enabling the unit, we don't actually do that in our testing environment (adding a symlink manually would work too, then again, why not just use the proper name?).
23 lines
573 B
Bash
Executable File
23 lines
573 B
Bash
Executable File
#!/bin/bash
|
|
#
|
|
# LEAK_DETECTIVE_LOG is set for automated runs, however, this is not passed
|
|
# to a process started via systemctl. This wrapper is used to set the variable
|
|
# for the strongswan.service unit.
|
|
|
|
ORIG=/bin/systemctl
|
|
CONF=/lib/systemd/system/strongswan.service
|
|
|
|
if [[ "$2" != "strongswan" ]]; then
|
|
$ORIG "$@"
|
|
fi
|
|
|
|
if [[ "$1" == "start" && -n $LEAK_DETECTIVE_LOG ]]; then
|
|
sed -i "s:Type=:Environment=LEAK_DETECTIVE_LOG=$LEAK_DETECTIVE_LOG\nType=:" $CONF 2>/dev/null
|
|
fi
|
|
|
|
$ORIG "$@"
|
|
|
|
if [[ "$1" == "stop" ]]; then
|
|
sed -i '/LEAK_DETECTIVE_LOG/d' $CONF 2>/dev/null
|
|
fi
|