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,23 @@
#!/usr/bin/env bash
faillock_conf="/etc/security/faillock.conf"
expected_value=900
value="unlock_time"
regex_pattern="^\s*#*\s*${value}\s*=\s*[0-9]+"
if grep -Eq "$regex_pattern" "$faillock_conf"; then
current_value=$(grep -E "$regex_pattern" "$faillock_conf" | head -n 1 | sed -E "s/.*=\s*([0-9]+)/\1/" | tr -d ' ')
if [[ $current_value =~ ^# ]]; then
echo "ERROR: The line is commented out"
exit 1
fi
if ((current_value < expected_value)); then
echo "ERROR: unlock_time = $current_value < $expected_value"
exit 1
else
exit 0
fi
else
echo "ERROR: No such line found for unlock_time in $faillock_conf"
exit 1
fi