3
# Copyright 2000,2001,2002 by Dennis Schoen <dennis@cobolt.net>
5
# This program is free software; you can redistribute it and/or modify
6
# it under the terms of the GNU General Public License as published by
7
# the Free Software Foundation; either version 2 of the License, or
8
# (at your option) any later version.
10
# This program is distributed in the hope that it will be useful,
11
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
# GNU General Public License for more details.
15
# You should have received a copy of the GNU General Public
16
# License along with this program; if not, write to the Free
17
# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
20
# Source debconf library
21
. /usr/share/debconf/confmodule
24
# Check the interface status, abort with error if a configured one is not
26
[ -z "$INTERFACES" ] && return 0
27
{ echo $INTERFACES | awk -F , '{ for(i=1;i<=NF;i++) print $i }' |
29
if ! netstat -i | grep "$iface" >/dev/null; then
39
if [ -e /etc/ntop/init.cfg ] && [ ! -e /var/lib/ntop/init.cfg ]; then
40
cp -a /etc/ntop/init.cfg /etc/ntop/init.cfg.dpkg-old || true
41
mv /etc/ntop/init.cfg /var/lib/ntop/init.cfg || true
44
if [ -e /var/lib/ntop/init.cfg ]; then
45
# Read current state from configuration file
46
. /var/lib/ntop/init.cfg || true
47
db_set ntop/user $USER
48
db_set ntop/interfaces $INTERFACES
51
# Interface default in case /var/lib/ntop/init.cfg does not exist
52
[ -z "$INTERFACES" ] && INTERFACES=eth0
53
# Depending on whether the default interface is up or down we set the
57
db_input medium ntop/interfaces || true
59
db_input high ntop/interfaces || true
62
db_get ntop/interfaces
65
db_input medium ntop/user || true
72
db_input high ntop/admin_password || true
74
db_get ntop/admin_password
76
if [ -z "$RET" ]; then
77
db_input critical ntop/password_empty
82
db_input high ntop/admin_password_again
84
db_get ntop/admin_password_again
91
if ! [ -f /var/lib/ntop/ntop_pw.db ]; then
94
if [ "$curpass" != "$againpass" ]; then
95
db_input critical ntop/password_mismatch
98
ntop --set-admin-password="$curpass"