Skip to content

Commit 2e87423

Browse files
committed
apply: fix incorrect ipset removed during update
1 parent 8d48360 commit 2e87423

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

geoip-shell-apply.sh

+5-3
Original file line numberDiff line numberDiff line change
@@ -352,9 +352,11 @@ for direction in inbound outbound; do
352352
*"$ipset"*) [ "$action" = update ] && printf '%s\n' "Ip set for '$list_id' is already up-to-date." ;;
353353
# check for ipset with different date
354354
*"$list_id_short"*)
355-
unexp_ipsets_apply="$(printf %s "$curr_ipsets" | grep "$list_id_short" | tr '\n' ' ')"
356-
case "$action" in add|restore) die "Detected ipset(s) with unexpected dates: $unexp_ipsets_apply."; esac
357-
add2list rm1_ipsets "$ipset"
355+
get_matching_line "$curr_ipsets" "*" "$list_id_short" "*" old_ipset
356+
case "$action" in add|restore)
357+
die "Detected ipset with unexpected date: $old_ipset."
358+
esac
359+
add2list rm1_ipsets "$old_ipset"
358360
esac
359361

360362
add2list planned_ipsets "$ipset"

0 commit comments

Comments
 (0)