]> git.deb.at Git - pkg/t-prot.git/blob - debian/postinst
Imported Debian patch 2.1-2
[pkg/t-prot.git] / debian / postinst
1 #!/bin/sh -e
2 # postinst for t-prot
3
4 # Source debconf library.
5 if [ -e /usr/share/debconf/confmodule ]; then
6         . /usr/share/debconf/confmodule
7 fi
8
9 if [ "$1" != 'configure' ] && [ "$1" != 'reconfigure' ]; then
10         exit 0
11 fi
12
13 # change existing symlink from ../Muttrc.t-prot to ../t-prot/Mutrc
14 if [ "$2" = "2.1-1" ] && [ -L /etc/Muttrc.d/t-prot.rc ]; then
15         cd /etc/Muttrc.d && ln -sf ../t-prot/Muttrc t-prot.rc || true
16 fi
17
18 # only on new install or reconfigure
19 if [ "x$2" = "x" ] || [ "$1" = "reconfigure" ] || [ "${DEBCONF_RECONFIGURE}" = "1" ]; then
20         symlink=true
21         if [ -e /usr/share/debconf/confmodule ]; then
22                 db_get t-prot/muttrc.d
23                 symlink="$RET"
24         fi
25
26         case "$symlink" in
27             true)
28                 mkdir /etc/Muttrc.d 2> /dev/null || true
29                 cd /etc/Muttrc.d && ln -sf ../t-prot/Muttrc t-prot.rc || true
30                 ;;
31             false)
32                 if [ -L /etc/Muttrc.d/t-prot.rc ]; then
33                         rm /etc/Muttrc.d/t-prot.rc
34                         rmdir /etc/Muttrc.d 2> /dev/null || true
35                 fi
36                 ;;
37         esac
38 fi