File: postinst

package info (click to toggle)
gwhois 20100728
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 224 kB
  • ctags: 13
  • sloc: perl: 471; sh: 65; makefile: 50
file content (52 lines) | stat: -rw-r--r-- 1,320 bytes parent folder | download | duplicates (5)
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
#!/bin/sh
# postinst script for gwhois
set -e
. /usr/share/debconf/confmodule

case "$1" in
  configure)
  db_get gwhois/inetd
  if [ "$RET" = "true" ]; then
    if [ "$(which update-inetd)" != "" ]; then
      update-inetd --add 'whois	 	stream	tcp 	nowait	nobody	/usr/bin/gwhois gwhois'
    else
      db_input high gwhois/noinetd
      db_go
    fi
  else
    if [ "$(which update-inetd)" != "" ]; then
      update-inetd --pattern gwhois --remove whois 2>&1 >/dev/null
    fi
  fi

  # delete old stuff
  if [ -f "/etc/gwhois/pattern.apnic-erx" ]; then
    md5sum=`md5sum </etc/gwhois/pattern.apnic-erx`
    if [ "$md5sum" = "e8be636f559802c54d4dcf89e374296b  -" ]; then
      rm /etc/gwhois/pattern.apnic-erx
    fi
  fi

  if [ -f "/etc/gwhois/pattern.lacnic-erx" ]; then
    md5sum=`md5sum </etc/gwhois/pattern.lacnic-erx`
    if [ "$md5sum" = "df6148697584ac98f7fe2bb7e59537a9  -" ]; then
      rm /etc/gwhois/pattern.lacnic-erx
    fi
  fi

  if [ -f "/etc/gwhois/pattern.ripe-erx" ]; then
    md5sum=`md5sum </etc/gwhois/pattern.ripe-erx`
    if [ "$md5sum" = "13910064af2b2d390e6e5d3ee6a7b151  -" ]; then
      rm /etc/gwhois/pattern.ripe-erx
    fi
  fi
  ;;
  abort-upgrade|abort-remove|abort-deconfigure)
  ;;
  *)
  echo "postinst called with unknown argument \`$1'" >&2
  exit 0
  ;;
esac

##DEBHELPER##