Skip to content

Commit

Permalink
Optimize conditional in bash remediation
Browse files Browse the repository at this point in the history
  • Loading branch information
marcusburghardt committed Jan 6, 2023
1 parent c143373 commit 7f3ef42
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion shared/templates/service_disabled/bash.template
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ SYSTEMCTL_EXEC='/usr/bin/systemctl'
"$SYSTEMCTL_EXEC" disable '{{{ DAEMONNAME }}}.service'
"$SYSTEMCTL_EXEC" mask '{{{ DAEMONNAME }}}.service'
# Disable socket activation if we have a unit file for it
if "$SYSTEMCTL_EXEC" list-unit-files | grep -q '^{{{ DAEMONNAME }}}.socket'; then
if "$SYSTEMCTL_EXEC" -q list-unit-files {{{ DAEMONNAME }}}.socket; then
"$SYSTEMCTL_EXEC" stop '{{{ DAEMONNAME }}}.socket'
"$SYSTEMCTL_EXEC" mask '{{{ DAEMONNAME }}}.socket'
fi
Expand Down

0 comments on commit 7f3ef42

Please sign in to comment.