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-custom-xrdp" |
---|
20 | case "$1" in |
---|
21 | configure) |
---|
22 | |
---|
23 | ORIGINAL_FILE="/etc/xrdp/startwm.sh" |
---|
24 | LLIUREX_FILE="/etc/xrdp/startwm.lliurex" |
---|
25 | NEW_FILE="/etc/xrdp/startwm.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 $LLIUREX_FILE $ORIGINAL_FILE |
---|
34 | fi |
---|
35 | fi |
---|
36 | |
---|
37 | ORIGINAL_FILE="/etc/xrdp/km-0409.ini" |
---|
38 | NEW_FILE="/etc/xrdp/km-0409.ini.diverted" |
---|
39 | LLIUREX_FILE="/etc/xrdp/km-0409.lliurex" |
---|
40 | |
---|
41 | if [ ! -L "$KM_FILE" ] ; then |
---|
42 | |
---|
43 | dpkg-divert --package $PACKAGE_NAME --rename --add --divert $NEW_FILE $ORIGINAL_FILE |
---|
44 | ln -s $LLIUREX_FILE $ORIGINAL_FILE |
---|
45 | fi |
---|
46 | |
---|
47 | |
---|
48 | |
---|
49 | |
---|
50 | |
---|
51 | ;; |
---|
52 | |
---|
53 | |
---|
54 | |
---|
55 | abort-upgrade|abort-remove|abort-deconfigure) |
---|
56 | ;; |
---|
57 | |
---|
58 | *) |
---|
59 | echo "postinst called with unknown argument \`$1'" >&2 |
---|
60 | exit 1 |
---|
61 | ;; |
---|
62 | esac |
---|
63 | |
---|
64 | # dh_installdeb will replace this with shell code automatically |
---|
65 | # generated by other debhelper scripts. |
---|
66 | |
---|
67 | #DEBHELPER# |
---|
68 | |
---|
69 | exit 0 |
---|