~ubuntu-branches/ubuntu/natty/ntop/natty

« back to all changes in this revision

Viewing changes to debian/ntop.config

  • Committer: Bazaar Package Importer
  • Author(s): Ludovico Cavedon, Jordan Metzmeier, Ludovico Cavedon
  • Date: 2010-12-15 20:06:19 UTC
  • mfrom: (5.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20101215200619-0ojz3iak95ihibun
Tags: 3:4.0.3+dfsg1-1
[ Jordan Metzmeier ]
* New upstream release (Closes: #522042)
* Move data files to /usr/share/ntop (Closes: #595450).
* Package architecture independent data in a separate ntop-data package.
* Use debhelper 7.
* Update Standards-Version to 3.9.1.
* Depend on python-mako.
* Do not include ntop.txt in binary packages as it is a copy of the man
  page.
* Do not include NEWS, as it is outdated.
* Switch to package source version 3.0 (quilt).
* Add password creation to debconf
* Changed init script to fix localization problems (thanks to Alejandro
  Varas <alej0varas@gmail.com>, LP: #257466)
* Remove manual update-rc.d calls from postrm and postinst. debhelper adds
  this for us.
* Add pre-depends on adduser for postinst script.
* Fix errors in the manpages: fix-manpage-errors.patch.
* Added fixes for matching active interfaces.
* Added a watch file.

[ Ludovico Cavedon ]
* Remove direct changes to upstream tree, and move them into specific patch
  files:
  - fix-manpage-errors.patch: fix typos in ntop.8.
  - dot-path.patch: fix path of /usr/bin/dot executable
* Add patches:
  - reduce-autogen-purged-files.patch: prevent agutogen.sh from reamoving
  too many files during cleanup.
  - Add build-without-ntop-darwin.patch, to fix compilation without
  ntop_darwin.c.
* No longer add faq.html, as it is not distributed in the upstream tarball.
* Use ${source:Version} in control file. Have ntop-data recommend
  ntop.
* Rename dirs to ntop.dirs and keep only empty directories that need
  to be created.
* Remove var/lib from ntop.install file, as it is empty (keeping it in
  ntop.dirs).
* Update po files.
* Breaks and Replaces instead of Conflitcs for ntop-data.
* Use a longer package description.
* Remove useless configure options from debian/rules.
* Move private shared libraries libraries in /usr/lib/ntop.
* Add change-plugin-dir.patch for adjusting plugin directory.
* Remove development files.
* Use system library for MochiKit.js.
* Rewrite DEP5 copyright file.
* Repackage upstream tarball in order to remove non-DFSG-compliant code. Add
  get-orig-source.sh script and get-orig-source target in debian/rules.
* Add explanation to README.Debian why geolocation is no longer working.
* Add avoid-copy-maxmind-db.patch to prevent copying of Geo*.dat
  files.
* Remove old unused patches.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh -e
 
2
#
 
3
# Copyright 2000,2001,2002 by Dennis Schoen <dennis@cobolt.net>
 
4
#
 
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.
 
9
#
 
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.
 
14
#
 
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,
 
18
# MA  02111-1307  USA.
 
19
 
 
20
# Source debconf library
 
21
. /usr/share/debconf/confmodule
 
22
 
 
23
check_interfaces() {
 
24
# Check the interface status, abort with error if a configured one is not
 
25
# available
 
26
        [ -z "$INTERFACES" ] && return 0
 
27
        { echo $INTERFACES | awk -F , '{ for(i=1;i<=NF;i++) print $i }' |
 
28
        while read iface ; do
 
29
                if ! netstat -i | grep "$iface" >/dev/null; then
 
30
                        return 1
 
31
                fi
 
32
        done
 
33
        return 0
 
34
        }
 
35
        return $?
 
36
}
 
37
 
 
38
 
 
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
 
42
fi
 
43
 
 
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
 
49
fi
 
50
 
 
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
 
54
# question priority
 
55
if check_interfaces
 
56
then
 
57
        db_input medium ntop/interfaces || true
 
58
else
 
59
        db_input high ntop/interfaces || true
 
60
fi
 
61
db_go
 
62
db_get ntop/interfaces
 
63
INTERFACES=$RET
 
64
 
 
65
db_input medium ntop/user || true
 
66
db_go
 
67
db_get ntop/user
 
68
 
 
69
 
 
70
set_password() {
 
71
    while [ 1 ]; do
 
72
        db_input high ntop/admin_password || true
 
73
        db_go
 
74
        db_get ntop/admin_password
 
75
 
 
76
        if [ -z "$RET" ]; then
 
77
            db_input critical ntop/password_empty
 
78
            db_go
 
79
        else
 
80
            curpass=$RET
 
81
 
 
82
            db_input high ntop/admin_password_again
 
83
            db_go
 
84
            db_get ntop/admin_password_again
 
85
            againpass=$RET
 
86
            break
 
87
        fi
 
88
    done
 
89
}
 
90
 
 
91
if ! [ -f /var/lib/ntop/ntop_pw.db ]; then
 
92
    while [ 1 ]; do
 
93
        set_password
 
94
        if [ "$curpass" != "$againpass" ]; then
 
95
            db_input critical ntop/password_mismatch
 
96
            db_go
 
97
        else
 
98
            ntop --set-admin-password="$curpass"
 
99
            break
 
100
        fi
 
101
    done
 
102
fi
 
103