diff --git a/ubl-arch.sh b/ubl-arch.sh index 071dc60..6b0320d 100755 --- a/ubl-arch.sh +++ b/ubl-arch.sh @@ -1,6 +1,6 @@ #!/bin/sh # 2024-05-26 -# lastmod: 2024-09-08 +# lastmod: 2024-10-05 # Dominic Reich BFILE=/srv/http/blocked.txt @@ -16,13 +16,13 @@ OLDNUM=$(sudo ipset --terse -L | grep "Number of entries:" | cut -d: -f2 | xargs while read ip; do sudo ipset -exist -A badips "$ip"; done < $IPFILE -FILEBACKUP=14 +FILEBACKUP=3 if [ ${FILEBACKUP} -ne 0 ]; then sudo cp ${BFILE} ${BFILE}.$(date +%Y%m%d) fi -BACKUPCOUNT=$(ls ${BFILE}* | wc -l) +BACKUPCOUNT=$(ls ${BFILE}.* | wc -l) BACKUPSTODELETE=$(expr ${BACKUPCOUNT} - ${FILEBACKUP}) if [ ${BACKUPCOUNT} -gt ${FILEBACKUP} ]; then for f in $(ls -tr ${BFILE}.* | head -${BACKUPSTODELETE})