File: ipset-persistent.postinst

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 (29 lines) | stat: -rw-r--r-- 671 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
#!/bin/sh

set -e

# Source debconf library
. /usr/share/debconf/confmodule

case "$1" in
configure)
    db_get ipset-persistent/autosave_done || true
    if [ "x$RET" != "xtrue" ]; then
        db_get ipset-persistent/autosave || true
        if [ "x$RET" = "xtrue" ]; then
            if which ipset > /dev/null ; then
                if ipset list > /dev/null; then
                    ipset save > /etc/iptables/ipsets
                else
                    echo "IPset: Unable to save sets (module not loadable or other problem)"
                fi
            fi
        fi

        db_set ipset-persistent/autosave_done true || true
    fi

;;
esac

#DEBHELPER#