File: postinst

package info (click to toggle)
im 1%3A153-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 1,476 kB
  • sloc: perl: 8,172; sh: 3,333; makefile: 140
file content (64 lines) | stat: -rw-r--r-- 1,444 bytes parent folder | download | duplicates (2)
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
#! /bin/sh
set -e

. /usr/share/debconf/confmodule

db_get im/rpop
if [ "$RET" = "true" ]; then
  if [ x = x"`command -v suidperl`" ]; then
    echo "The suidperl command is not found."
    db_purge
    exit 255
  else
    if dpkg-statoverride --list /usr/bin/imget >/dev/null ; then
      dpkg-statoverride --remove /usr/bin/imget
    fi
    dpkg-statoverride --update --add root root 4755 /usr/bin/imget
  fi
else
  if dpkg-statoverride --list /usr/bin/imget >/dev/null ; then
    dpkg-statoverride --remove /usr/bin/imget
  fi
  chmod 0755 /usr/bin/imget
fi

db_get im/siteconfig_by_hand
if [ "$RET" = "false" ]; then
  db_get im/fromdomain
  FROM_DOMAIN="$RET"

  db_get im/todomain
  TO_DOMAIN="$RET"

  db_get im/organization
  ORGANIZATION="$RET"

  db_get im/use_maildir
  if [ "$RET" = "true" ]; then
    MBOXSTYLE="qmail"
  else
    MBOXSTYLE=""
  fi

  TMPCONFIG=/etc/im/SiteConig.postinst-tmp
  cat <<POSTINST_EOF_OF_IM > $TMPCONFIG
FromDomain=$FROM_DOMAIN	# domain of your mail address
ToDomain=$TO_DOMAIN	# domain when domain part is omitted
Org=$ORGANIZATION	# for news posting
MBoxStyle=$MBOXSTYLE	# qmail or not
POSTINST_EOF_OF_IM

  if [ -f /etc/im/SiteConfig ]; then
    if cmp -s /etc/im/SiteConfig $TMPCONFIG ; then
      rm -f $TMPCONFIG
    else
      savelog /etc/im/SiteConfig
      rm -f /etc/im/SiteConfig
      mv $TMPCONFIG /etc/im/SiteConfig
    fi
  else
    mv $TMPCONFIG /etc/im/SiteConfig
  fi
fi

#DEBHELPER#