aboutsummaryrefslogtreecommitdiffstats
path: root/main/ipset/ipset.initd
diff options
context:
space:
mode:
Diffstat (limited to 'main/ipset/ipset.initd')
-rw-r--r--main/ipset/ipset.initd24
1 files changed, 24 insertions, 0 deletions
diff --git a/main/ipset/ipset.initd b/main/ipset/ipset.initd
new file mode 100644
index 0000000000..6e3294c8e0
--- /dev/null
+++ b/main/ipset/ipset.initd
@@ -0,0 +1,24 @@
+#!/sbin/runscript
+# Init script for ipset
+# Copyright (C) 2012 Kaarle Ritvanen
+# Licensed under the terms of the GPL2
+
+depend() {
+ before iptables ip6tables
+}
+
+start() {
+ if ls /etc/ipset.d/* &> /dev/null; then
+ ebegin "Loading firewall IP sets"
+ for f in /etc/ipset.d/*; do
+ /usr/sbin/ipset restore < $f
+ done
+ eend $?
+ fi
+}
+
+stop() {
+ ebegin "Flushing firewall IP sets"
+ /usr/sbin/ipset destroy
+ eend $?
+}