mirror of
https://github.com/docker/docker-bench-security.git
synced 2025-01-31 14:22:33 +01:00
if systemctl show fails, use /usr/lib/systemd/system/ path
Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>
This commit is contained in:
parent
606f70f83f
commit
e19f997b3f
1 changed files with 7 additions and 1 deletions
|
@ -88,5 +88,11 @@ get_docker_effective_command_line_args() {
|
||||||
|
|
||||||
get_systemd_service_file(){
|
get_systemd_service_file(){
|
||||||
SERVICE="$1"
|
SERVICE="$1"
|
||||||
systemctl show -p FragmentPath "$SERVICE" | sed 's/.*=//'
|
|
||||||
|
systemctl show -p FragmentPath "$SERVICE" 2> /dev/null 1>&2
|
||||||
|
if [ $? -eq 0 ]; then
|
||||||
|
systemctl show -p FragmentPath "$SERVICE" | sed 's/.*=//'
|
||||||
|
else
|
||||||
|
echo "/usr/lib/systemd/system/$SERVICE"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue