gfwlist2ipset 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/bin/gfwlist2ipset +11 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 58cc997f476e71ad84a6cd1d1b268195d587f346
|
4
|
+
data.tar.gz: 78c1593784e47bdd4e1e68c455b58c75f0dcb965
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 21bb6a67e5fe18eb5f28ae2a216d8931fa05ec907d1907464d6febe0c2fd0792da88af95a0a210bcfa1bc9534a338f5c3fb398eb0285b8cdb432dd63b2fccae0
|
7
|
+
data.tar.gz: a8f93340ec6eb6ba2b3fb32975bf825870ce7330e4918cf3808da5b34163fd55349475964b485cbf80d63fc05c296f0b0d7aa635e9ba430853db0b9960725a2f
|
data/bin/gfwlist2ipset
CHANGED
@@ -8,14 +8,20 @@ options = {}
|
|
8
8
|
OptionParser.new do |opts|
|
9
9
|
opts.banner = "Usage: gfwlist2ipset [options]"
|
10
10
|
|
11
|
-
|
12
|
-
|
11
|
+
options[:ipset] = 'outwall'
|
12
|
+
options[:output] = 'gfwlist.conf'
|
13
|
+
|
14
|
+
opts.on('', '--ipset <ipset name>', 'Specify ipset name, default: outwall') do |value|
|
15
|
+
options[:ipset] = value
|
13
16
|
end
|
14
17
|
|
15
|
-
options[:output] = 'gfwlist.conf'
|
16
18
|
opts.on('-o OUTPUT', '--output OUTPUT', 'Output file, default: gfwlist.conf') do |value|
|
17
19
|
options[:output] = value
|
18
20
|
end
|
21
|
+
|
22
|
+
opts.on('-d <DNS Server>', '--dns <DNS Server>', 'Specify DNS Server') do |value|
|
23
|
+
options[:dns] = value
|
24
|
+
end
|
19
25
|
end.parse!
|
20
26
|
|
21
27
|
gfwlist_url = 'https://autoproxy-gfwlist.googlecode.com/svn/trunk/gfwlist.txt'
|
@@ -107,11 +113,11 @@ File.open(options[:output], 'w+') do |f|
|
|
107
113
|
if options.has_key?(:dns)
|
108
114
|
domains.sort.uniq.each do |domain|
|
109
115
|
f.puts('server=/' + domain + '/' + options[:dns])
|
110
|
-
f.puts('ipset=/' + domain + '/
|
116
|
+
f.puts('ipset=/' + domain + '/' + options[:ipset])
|
111
117
|
end
|
112
118
|
else
|
113
119
|
domains.sort.uniq.each do |domain|
|
114
|
-
f.puts('ipset=/' + domain + '/
|
120
|
+
f.puts('ipset=/' + domain + '/' + options[:ipset])
|
115
121
|
end
|
116
122
|
end
|
117
123
|
end
|