File: mkpubsuffixcc

package info (click to toggle)
pdns-recursor 5.3.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 11,116 kB
  • sloc: cpp: 109,650; javascript: 20,651; python: 5,657; sh: 5,094; makefile: 780; ansic: 582; xml: 37
file content (17 lines) | stat: -rwxr-xr-x 429 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh
if [ -z "$1" ]; then
  echo "Usage: $0 pubsuffix.cc"
  exit 1
fi
set -e
echo "Downloading public suffix data and generating $1"
temp=$(mktemp pubsuffixXXXXXX)
trap "rm -f $temp" 0 1 2 3 15
set -e
curl -o $temp -s -S https://publicsuffix.org/list/public_suffix_list.dat
(echo "const char* g_pubsuffix[]={";
	for a in $(grep -v "//" "$temp" | grep \\. | egrep "^[.0-9a-z-]*$")
	do
		echo \"$a\",
	done
echo "0};") > "$1"