Skip to content

Instantly share code, notes, and snippets.

@tmkasun
Last active March 24, 2022 10:16
Embed
What would you like to do?
OpenWRT Create IPset on router startup
#!/bin/sh /etc/rc.common
# OpenWrt /etc/init.d/ script to automatically add ipsets across reboots
# For more info about how to write init scripts https://openwrt.org/docs/techref/initscripts
#
# howto:
# - upload this file as /etc/init.d/autoipset
# - # chmod 755 /etc/init.d/autoipset
# - # /etc/init.d/autoipset enable
# - # /etc/init.d/autoipset start
# queue this init script to start (i.e., create IPSet) right before dnsmasq starts (19)
START=18
setipset() {
ipset -N fbcdn hash:ip
ipset -N facebook hash:ip
}
start() {
setipset
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment