1 | #!/bin/sh |
---|
2 | # |
---|
3 | # see: dh_installdeb(1) |
---|
4 | |
---|
5 | set -e |
---|
6 | |
---|
7 | # summary of how this script can be called: |
---|
8 | # * <postinst> `configure' <most-recently-configured-version> |
---|
9 | # * <old-postinst> `abort-upgrade' <new version> |
---|
10 | # * <conflictor's-postinst> `abort-remove' `in-favour' <package> |
---|
11 | # <new-version> |
---|
12 | # * <postinst> `abort-remove' |
---|
13 | # * <deconfigured's-postinst> `abort-deconfigure' `in-favour' |
---|
14 | # <failed-install-package> <version> `removing' |
---|
15 | # <conflicting-package> <version> |
---|
16 | # for details, see http://www.debian.org/doc/debian-policy/ or |
---|
17 | # the debian-policy package |
---|
18 | |
---|
19 | PACKAGE_NAME="lliurex-enterprise-mount" |
---|
20 | case "$1" in |
---|
21 | configure) |
---|
22 | |
---|
23 | ORIGINAL_FILE="/etc/pam.d/lightdm" |
---|
24 | LLIUREX_FILE="/etc/pam.d/lightdm.lliurex" |
---|
25 | NEW_FILE="/etc/pam.d/lightdm.diverted" |
---|
26 | if [ ! -r "$NEW_FILE" ] ; then |
---|
27 | dpkg-divert --package $PACKAGE_NAME --rename --add --divert $NEW_FILE $ORIGINAL_FILE |
---|
28 | fi |
---|
29 | |
---|
30 | if [ ! -L $ORIGINAL_FILE ] ; then |
---|
31 | if [ "$(readlink -f $ORIGINAL_FILE)" != "${LLIUREX_FILE}" ] ; then |
---|
32 | rm -rf $ORIGINAL_FILE || true |
---|
33 | ln -fs ${ORIGINAL_FILE}.lliurex $ORIGINAL_FILE |
---|
34 | fi |
---|
35 | fi |
---|
36 | |
---|
37 | ORIGINAL_FILE="/usr/share/pam-configs/libpam-mount" |
---|
38 | NEW_FILE="/usr/share/llx-pam-configs/diverted/libpam-mount.diverted" |
---|
39 | if [ ! -r "$NEW_FILE" ] ; then |
---|
40 | dpkg-divert --package $PACKAGE_NAME --rename --add --divert $NEW_FILE $ORIGINAL_FILE |
---|
41 | fi |
---|
42 | ORIGINAL_FILE="/usr/share/pam-configs/pam_script" |
---|
43 | NEW_FILE="/usr/share/llx-pam-configs/diverted/pam_script.diverted" |
---|
44 | if [ ! -r "$NEW_FILE" ] ; then |
---|
45 | dpkg-divert --package $PACKAGE_NAME --rename --add --divert $NEW_FILE $ORIGINAL_FILE |
---|
46 | fi |
---|
47 | |
---|
48 | ORIGINAL_FILE="/etc/security/pam_mount.conf.xml" |
---|
49 | NEW_FILE="/etc/security/pam_mount.conf.xml.diverted" |
---|
50 | |
---|
51 | if [ ! -r "$NEW_FILE" ] ; then |
---|
52 | dpkg-divert --package $PACKAGE_NAME --rename --add --divert $NEW_FILE $ORIGINAL_FILE |
---|
53 | fi |
---|
54 | |
---|
55 | if [ ! -L $ORIGINAL_FILE ] ; then |
---|
56 | if [ "$(readlink -f $ORIGINAL_FILE)" != "${LLIUREX_FILE}" ] ; then |
---|
57 | rm -rf $ORIGINAL_FILE || true |
---|
58 | ln -fs ${ORIGINAL_FILE}.lliurex $ORIGINAL_FILE |
---|
59 | fi |
---|
60 | fi |
---|
61 | |
---|
62 | ORIGINAL_FILE="/opt/pbis/share/pbis.pam-auth-update" |
---|
63 | LLIUREX_FILE="/opt/pbis/share/pbis.pam-auth-update.lliurex" |
---|
64 | NEW_FILE="/opt/pbis/share/pbis.pam-auth-update.diverted" |
---|
65 | if [ ! -r "$NEW_FILE" ] ; then |
---|
66 | dpkg-divert --package $PACKAGE_NAME --rename --add --divert $NEW_FILE $ORIGINAL_FILE |
---|
67 | fi |
---|
68 | |
---|
69 | if [ ! -L $ORIGINAL_FILE ] ; then |
---|
70 | if [ "$(readlink -f $ORIGINAL_FILE)" != "${LLIUREX_FILE}" ] ; then |
---|
71 | rm -rf "$ORIGINAL_FILE" || true |
---|
72 | ln -fs "$LLIUREX_FILE" "$ORIGINAL_FILE" |
---|
73 | fi |
---|
74 | fi |
---|
75 | |
---|
76 | |
---|
77 | pam-auth-update --package |
---|
78 | |
---|
79 | update-icon-caches /usr/share/icons/hicolor || true |
---|
80 | |
---|
81 | |
---|
82 | |
---|
83 | ;; |
---|
84 | |
---|
85 | |
---|
86 | |
---|
87 | abort-upgrade|abort-remove|abort-deconfigure) |
---|
88 | ;; |
---|
89 | |
---|
90 | *) |
---|
91 | echo "postinst called with unknown argument \`$1'" >&2 |
---|
92 | exit 1 |
---|
93 | ;; |
---|
94 | esac |
---|
95 | |
---|
96 | # dh_installdeb will replace this with shell code automatically |
---|
97 | # generated by other debhelper scripts. |
---|
98 | |
---|
99 | #DEBHELPER# |
---|
100 | |
---|
101 | exit 0 |
---|