mirror of
https://github.com/docker/docker-bench-security.git
synced 2025-01-18 16:22:33 +01:00
systemctl always returns an FragmentPath
Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>
This commit is contained in:
parent
e081393ad7
commit
287fd8774b
1 changed files with 4 additions and 4 deletions
|
@ -140,14 +140,14 @@ get_service_file() {
|
||||||
echo "/lib/systemd/system/$SERVICE"
|
echo "/lib/systemd/system/$SERVICE"
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
if systemctl show -p FragmentPath "$SERVICE" 2> /dev/null 1>&2; then
|
|
||||||
systemctl show -p FragmentPath "$SERVICE" | sed 's/.*=//'
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
if find /run -name "$SERVICE" 2> /dev/null 1>&2; then
|
if find /run -name "$SERVICE" 2> /dev/null 1>&2; then
|
||||||
find /run -name "$SERVICE" | head -n1
|
find /run -name "$SERVICE" | head -n1
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
if [ "$(systemctl show -p FragmentPath "$SERVICE" | sed 's/.*=//')" != "" ]; then
|
||||||
|
systemctl show -p FragmentPath "$SERVICE" | sed 's/.*=//'
|
||||||
|
return
|
||||||
|
fi
|
||||||
echo "/usr/lib/systemd/system/$SERVICE"
|
echo "/usr/lib/systemd/system/$SERVICE"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue