summaryrefslogtreecommitdiff
path: root/testing/hosts/default/usr/local/bin
diff options
context:
space:
mode:
authorYves-Alexis Perez <corsac@debian.org>2018-09-24 15:11:14 +0200
committerYves-Alexis Perez <corsac@debian.org>2018-09-24 15:11:14 +0200
commite0e280b7669435b991b7e457abd8aa450930b3e8 (patch)
tree3e6084f13b14ad2df104e2ce6e589eb96c5f7ac9 /testing/hosts/default/usr/local/bin
parent51a71ee15c1bcf0e82f363a16898f571e211f9c3 (diff)
downloadvyos-strongswan-e0e280b7669435b991b7e457abd8aa450930b3e8.tar.gz
vyos-strongswan-e0e280b7669435b991b7e457abd8aa450930b3e8.zip
New upstream version 5.7.0
Diffstat (limited to 'testing/hosts/default/usr/local/bin')
-rwxr-xr-xtesting/hosts/default/usr/local/bin/systemctl22
1 files changed, 22 insertions, 0 deletions
diff --git a/testing/hosts/default/usr/local/bin/systemctl b/testing/hosts/default/usr/local/bin/systemctl
new file mode 100755
index 000000000..bbe2bc9b3
--- /dev/null
+++ b/testing/hosts/default/usr/local/bin/systemctl
@@ -0,0 +1,22 @@
+#!/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-swanctl.service unit.
+
+ORIG=/bin/systemctl
+CONF=/lib/systemd/system/strongswan-swanctl.service
+
+if [[ "$2" != "strongswan-swanctl" ]]; 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