A=/root/lab-answers # A wrong SSH password since the lab started, in the journal or the log files. failed_logged() { journalctl --since "@$(state_get start)" 2>/dev/null | grep -q "Failed password" && return 0 local f for f in /var/log/secure /var/log/auth.log; do [ -f "$f" ] || continue [ "$(grep -c 'Failed password' "$f")" -gt "$(state_get "failed-${f##*/}" || echo 0)" ] && return 0 done return 1 } new_shell() { env -i HOME=/root TERM=dumb PATH=/usr/sbin:/usr/bin:/sbin:/bin bash -ic "$1" 2>/dev/null; } task 1 "~/practice/a/b made" need "/root/practice/a/b is a directory" '[ -d /root/practice/a/b ]' task 2 "The .conf files under /etc listed in ~/conf-files.txt and counted" need "/root/conf-files.txt lists files under /etc ending in .conf" '[ "$(grep -c "^/etc/.*\.conf$" /root/conf-files.txt)" -gt 20 ] && ! grep -v "\.conf$" /root/conf-files.txt | grep -q .' need "it lists most of them" '[ $(( $(wc -l