~ubuntu-branches/ubuntu/karmic/pdnsd/karmic

« back to all changes in this revision

Viewing changes to debian/postinst

  • Committer: Bazaar Package Importer
  • Author(s): Pierre Habouzit
  • Date: 2008-10-05 09:54:52 UTC
  • mfrom: (4.1.4 intrepid)
  • Revision ID: james.westby@ubuntu.com-20081005095452-wc58cmdofvyipcv3
Tags: 1.2.6-par-10
* Add patches/0005-fix-for-CVE-2008-4194.patch for CVE-2008-4194.
  (Closes: #500910).
* Document where the two default configuration are in README.Debian
  (Closes: #499984).
* Update turkish translation thanks to Mert Dirik (Closes: #490047).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/sh
2
 
 
3
 
set -e
4
 
 
5
 
id pdnsd > /dev/null 2>&1 || adduser --system --ingroup proxy --home /var/cache/pdnsd --no-create-home  --gecos pdnsd pdnsd || true
6
 
 
7
 
if [ "$1" = "configure" -a -n "$2" ] && dpkg --compare-versions "$2" lt "1.1" ; then
8
 
  if [ -f /var/cache/pdnsd/pdnsd.cache ]; then
9
 
    echo -n "Deleting old pdnsd cache... "
10
 
    rm -f /var/cache/pdnsd/pdnsd.cache
11
 
    echo "done."
12
 
  fi
13
 
fi
14
 
 
15
 
if [ ! -f /var/cache/pdnsd/pdnsd.cache ];then
16
 
        dd if=/dev/zero of=/var/cache/pdnsd/pdnsd.cache bs=1 count=4 2> /dev/null
17
 
fi
18
 
 
19
 
chown -R pdnsd:proxy /var/cache/pdnsd
20
 
 
21
 
sleep 2
 
1
#!/bin/sh -e
 
2
 
 
3
default_set_var() {
 
4
    sed -i -e "s/^\s*${1}\s*=\s*[^#]*/${1}=${2}/" /etc/default/pdnsd
 
5
}
 
6
 
 
7
if test "$1" = "configure"; then
 
8
    . /usr/share/debconf/confmodule
 
9
    db_version 2.0
 
10
    db_title pdnsd
 
11
 
 
12
    db_get pdnsd/conf || true
 
13
    case "$RET" in
 
14
        "Use resolvconf")
 
15
            default_set_var START_DAEMON yes
 
16
            default_set_var AUTO_MODE    resolvconf
 
17
            ;;
 
18
        "Use root servers")
 
19
            default_set_var START_DAEMON yes
 
20
            default_set_var AUTO_MODE    recurse
 
21
            ;;
 
22
        *)
 
23
            default_set_var AUTO_MODE    ""
 
24
            ;;
 
25
    esac
 
26
 
 
27
    db_stop
 
28
 
 
29
    # ensure rcS.d link is created, can be removed in lenny+1
 
30
    if dpkg --compare-versions "$2" lt "1.2.5par-0"; then
 
31
        update-rc.d -f pdnsd remove >/dev/null 2>/dev/null || true
 
32
    fi
 
33
 
 
34
    if ! getent passwd pdnsd > /dev/null; then
 
35
        adduser --quiet --system --ingroup proxy --no-create-home --home /var/cache/pdnsd pdnsd
 
36
    fi
 
37
 
 
38
    if [ ! -f /var/cache/pdnsd/pdnsd.cache ];then
 
39
        dd if=/dev/zero of=/var/cache/pdnsd/pdnsd.cache bs=1 count=4 2> /dev/null
 
40
    fi
 
41
 
 
42
    chown -R pdnsd:proxy /var/cache/pdnsd
 
43
fi
22
44
 
23
45
#DEBHELPER#
 
46
 
 
47
exit 0