Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision Next revisionBoth sides next revision | ||
| docs:guide-user:advanced:ipset_extras [2023/09/23 18:31] – [Instructions] optimize code vgaetera | docs:guide-user:advanced:ipset_extras [2023/10/18 07:56] – consolidate terminology vgaetera | ||
|---|---|---|---|
| Line 16: | Line 16: | ||
| * Fetch ASN prefixes using [[https:// | * Fetch ASN prefixes using [[https:// | ||
| * Fetch GeoIP data using [[https:// | * Fetch GeoIP data using [[https:// | ||
| - | * Use [[docs: | + | * Use [[docs: |
| ===== Commands ===== | ===== Commands ===== | ||
| Line 41: | Line 41: | ||
| config_foreach ipset_proc_" | config_foreach ipset_proc_" | ||
| uci_commit firewall | uci_commit firewall | ||
| - | / | + | service |
| fw4 reload-sets | fw4 reload-sets | ||
| } | } | ||
| Line 52: | Line 52: | ||
| config_list_foreach " | config_list_foreach " | ||
| config_list_foreach " | config_list_foreach " | ||
| - | config_list_foreach " | + | config_list_foreach " |
| } | sort -u > " | } | sort -u > " | ||
| config_list_foreach " | config_list_foreach " | ||
| Line 108: | Line 108: | ||
| } | } | ||
| - | ipset_geo() { | + | ipset_geoip() { |
| local IPSET_ENTRY=" | local IPSET_ENTRY=" | ||
| wget -O - " | wget -O - " | ||
| Line 124: | Line 124: | ||
| && [ ! -e / | && [ ! -e / | ||
| || [ -n " | || [ -n " | ||
| - | && lock -n / | + | && lock -n / |
| + | && sleep 10 | ||
| then . / | then . / | ||
| ipset setup | ipset setup | ||
| Line 138: | Line 139: | ||
| 0 */3 * * * . / | 0 */3 * * * . / | ||
| EOF | EOF | ||
| - | / | + | service |
| </ | </ | ||
| Line 157: | Line 158: | ||
| uci add_list dhcp.example.asn=" | uci add_list dhcp.example.asn=" | ||
| uci add_list dhcp.example.asn=" | uci add_list dhcp.example.asn=" | ||
| - | uci add_list dhcp.example.geo=" | + | uci add_list dhcp.example.geoip=" |
| - | uci add_list dhcp.example.geo=" | + | uci add_list dhcp.example.geoip=" |
| uci commit dhcp | uci commit dhcp | ||