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