Skip to content

Instantly share code, notes, and snippets.

@tmkasun
Last active June 15, 2023 00:35
Show Gist options
  • Save tmkasun/4f9e1fe6ed8254a115d2924f6b3b885d to your computer and use it in GitHub Desktop.
Save tmkasun/4f9e1fe6ed8254a115d2924f6b3b885d to your computer and use it in GitHub Desktop.

Revisions

  1. tmkasun revised this gist Jan 9, 2021. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion autoipset
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    #!/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
  2. tmkasun created this gist Jan 9, 2021.
    22 changes: 22 additions & 0 deletions autoipset
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,22 @@
    #!/bin/sh /etc/rc.common

    # OpenWrt /etc/init.d/ script to automatically add ipsets across reboots
    #
    #
    # 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
    }