Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpnSense
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
OpnSense
Commits
e9d9a983
Commit
e9d9a983
authored
Nov 07, 2016
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
firewall: download bogons per ABI (backwards-compatible)
parent
5d3729e4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
4 deletions
+14
-4
rc.update_bogons
src/etc/rc.update_bogons
+14
-4
No files found.
src/etc/rc.update_bogons
View file @
e9d9a983
#!/bin/sh
v4url
=
"https://pkg.opnsense.org/bogons/fullbogons-ipv4.txt"
v6url
=
"https://pkg.opnsense.org/bogons/fullbogons-ipv6.txt"
CORE_ABI
=
$(
cat
/usr/local/opnsense/version/opnsense.abi 2> /dev/null
)
SYS_ABI
=
$(
opnsense-verify
-a
2> /dev/null
)
URL
=
"https://pkg.opnsense.org"
if
[
-n
"
${
CORE_ABI
}
"
-a
-n
"
${
SYS_ABI
}
"
]
;
then
# expand url to new mirror layout per release
URL
=
"
${
URL
}
/
${
SYS_ABI
}
/
${
CORE_ABI
}
"
fi
URL4
=
"
${
URL
}
/bogons/fullbogons-ipv4.txt"
URL6
=
"
${
URL
}
/bogons/fullbogons-ipv6.txt"
proc_error
=
process_url
()
...
...
@@ -39,7 +49,7 @@ fi
echo
"rc.update_bogons is beginning the update cycle."
| logger
if
process_url /tmp/bogons
"
${
v4url
}
"
;
then
if
process_url /tmp/bogons
"
${
URL4
}
"
;
then
ENTRIES_MAX
=
`
pfctl
-s
memory |
awk
'/table-entries/ { print $4 }'
`
ENTRIES_TOT
=
`
pfctl
-vvsTables
|
awk
'/Addresses/ {s+=$2}; END {print s}'
`
ENTRIES_V4
=
`
pfctl
-vvsTables
|
awk
'/-\tbogons$/ {getline; print $2}'
`
...
...
@@ -57,7 +67,7 @@ if process_url /tmp/bogons "${v4url}"; then
rm
/tmp/bogons
*
fi
if
process_url /tmp/bogonsv6
"
${
v6url
}
"
;
then
if
process_url /tmp/bogonsv6
"
${
URL6
}
"
;
then
ENTRIES_MAX
=
`
pfctl
-s
memory |
awk
'/table-entries/ { print $4 }'
`
ENTRIES_TOT
=
`
pfctl
-vvsTables
|
awk
'/Addresses/ {s+=$2}; END {print s}'
`
BOGONS_V6_TABLE_COUNT
=
`
pfctl
-sTables
|
grep
^bogonsv6
$
|
wc
-l
|
awk
'{ print $1 }'
`
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment