diff --git a/misc/blocklists/append_ipv4.sh b/misc/blocklists/append_ipv4.sh new file mode 100755 index 0000000..c389451 --- /dev/null +++ b/misc/blocklists/append_ipv4.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env bash + +set -euo pipefail; + +LIST_FILE="$(dirname "$0")/ipv4.txt"; +TMP_FILE="$(mktemp)"; + +IP_REGEX='(? "$TMP_FILE"; + +echo "$TMP_FILE"; +if diff "$LIST_FILE" "$TMP_FILE"; then + echo "No differences found!"; + exit 0; +fi + +echo "Press enter to approve changes, ^C to abort"; +read; + +mv "$TMP_FILE" "$LIST_FILE";