This file is indexed.

config is in ntop 3:4.1.0+dfsg1-1.

This file is a maintainer script. It is executed when installing (*inst) or removing (*rm) the package.

The actual contents of the file can be viewed below.

  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
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
#! /bin/sh
#
# Copyright 2000,2001,2002 by Dennis Schoen <dennis@cobolt.net>
#
# 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 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public
# License along with this program; if not, write to the Free
# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA  02111-1307  USA.

set -e

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

check_interfaces() {
# Check the interface status, abort with error if a configured one is not
# available
        [ -z "$INTERFACES" ] && return 0
        for iface in $(echo $INTERFACES | awk -F , '{ for(i=1;i<=NF;i++) print $i }')
        do
                if [ "$iface" != "none" ] && ! grep "$iface:" /proc/net/dev >/dev/null; then
                        return 1
                fi
        done
	return 0
}


if [ -e /etc/ntop/init.cfg ] && [ ! -e /var/lib/ntop/init.cfg ]; then
    cp -a /etc/ntop/init.cfg /etc/ntop/init.cfg.dpkg-old || true
    mv /etc/ntop/init.cfg /var/lib/ntop/init.cfg || true
fi

if [ -e /var/lib/ntop/init.cfg ]; then
  # Read current state from configuration file
  . /var/lib/ntop/init.cfg || true
  db_set ntop/user "$USER"
  db_set ntop/interfaces "$INTERFACES"
fi

# Interface default in case /var/lib/ntop/init.cfg does not exist
[ -z "$INTERFACES" ]  && INTERFACES=eth0
# Depending on whether the default interface is up or down we set the
# question priority
if check_interfaces
then
	db_input medium ntop/interfaces || true
else
	db_input high ntop/interfaces || true
fi

db_input low ntop/user || true


set_password() {
    while true; do
	db_input high ntop/admin_password || debconfret=$?
        if [ -n "$debconfret" ] && [ "$debconfret" -eq 30 ]; then
            # question will not be displayed
            # ask other questions in the queue and terminate
            db_go
            break
        fi
        db_input high ntop/admin_password_again || true
	db_go

	db_get ntop/admin_password

	if [ -z "$RET" ]; then
	    db_input high ntop/password_empty
	    db_fset ntop/admin_password seen false
	    db_fset ntop/admin_password_again seen false
	else
	    curpass=$RET
	    db_get ntop/admin_password_again
	    againpass=$RET
	    if [ "$curpass" = "$againpass" ]; then
		break
	    else
		db_input high ntop/password_mismatch
            fi
        fi
    done
}

if ! [ -f /var/lib/ntop/ntop_pw.db ]; then
    set_password
else
    db_input low ntop/password_reset || true
    db_go
    db_get ntop/password_reset
    if [ "true" = "$RET" ]; then
	set_password
    else
	db_go
    fi
fi