This commit is contained in:
2026-05-11 09:15:08 +02:00
parent 9bec2b9e42
commit 404ee3fec4
641 changed files with 416825 additions and 0 deletions
@@ -0,0 +1,17 @@
#!/usr/bin/env bash
# Parameter to search for
parameter_config="enforcing"
unwanted_value=0
file="/etc/security/pwquality.conf"
# Search for the line containing the parameter with '=' and the unwanted value, even if commented
line=$(grep -E "^\s*$parameter_config\s*=\s*$unwanted_value\s*$" "$file")
# Check if the unwanted line exists
if [ -n "$line" ]; then
echo "Error: The line '$parameter_config=$unwanted_value' exists in $file (even if commented)."
exit 1
else
echo "No unwanted or commented line '$parameter_config=$unwanted_value' found in $file."
exit 0
fi