File: 40-ipset

package info (click to toggle)
iptables-persistent 1.0.11%2Bdeb10u1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 236 kB
  • sloc: sh: 336; makefile: 17
file content (57 lines) | stat: -rwxr-xr-x 1,193 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/sh

# This file is part of netfilter-persistent
# (was iptables-persistent)
# Copyright (C) 2018, gustavo panizzo <gfa@zumbi.com.ar>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation, either version 3
# of the License, or (at your option) any later version.

# This script only implement flush of rules as ipset have to flushed after
# there are no more references to it (iptables rules calling them)

set -e

PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

# Create the ipsets and populate them
load_sets ()
{
    :
}

# Save current contents of the ipsets to file
save_sets ()
{
    :
}

# flush sets
flush_sets ()
{
    ipset destroy
}


case "$1" in
start|restart|reload|force-reload)
	load_sets
	;;
save)
	save_sets
	;;
stop)
        # While it makes sense to stop (delete) ipsets we keep the same
        # semanthics as ip(6)?tables rules
	echo "Automatic flushing disabled, use \"flush\" instead of \"stop\""
	;;
flush)
	flush_sets
	;;
*)
    echo "Usage: $0 {start|restart|reload|force-reload|save|flush}" >&2
    exit 1
    ;;
esac