Fix restart rsyslog

This commit is contained in:
q3aql 2024-04-16 20:47:57 +02:00
parent 6b5bf99bce
commit 80c50daf13

View File

@ -121,7 +121,6 @@ while [ ${blockauth} -eq 0 ] ; do
echo "blockauth: allowing access for ${user}" >> ${filelog}
sed -i "s/Failed password for ${user} from/blockauth\[allowed\]\: invalid pass for ${user} from/g" /var/log/auth.log
sed -i "s/Failed password for invalid user ${user} from/blockauth\[allowed\]\: invalid pass for ${user} from/g" /var/log/auth.log
systemctl restart rsyslog &> /dev/null
done
# Reset blocklist when maximum is reached
num_blocklist=$(cat ${blocklist} | wc -l)
@ -140,6 +139,7 @@ while [ ${blockauth} -eq 0 ] ; do
sort -u ${blocklist}.temp > ${blocklist}
rm -rf ${blocklist}.temp
sed -i 's/Failed password for/blockauth\[blocked\]\: invalid pass for/g' /var/log/auth.log
systemctl restart rsyslog &> /dev/null
# Exclude allowed IPs
if [ -z "${always_ip_allowed}" ] ; then
echo "blockauth: running exclude allowed ips"