source: lliurex-custom-xrdp/trunk/fuentes/debian/postinst @ 4729

Last change on this file since 4729 was 4729, checked in by hectorgh, 2 years ago

wip

File size: 1.8 KB
Line 
1#!/bin/sh
2#
3# see: dh_installdeb(1)
4
5set -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
19PACKAGE_NAME="lliurex-custom-xrdp"
20case "$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                systemctl restart xrdp || true
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    ;;
62esac
63
64# dh_installdeb will replace this with shell code automatically
65# generated by other debhelper scripts.
66
67#DEBHELPER#
68
69exit 0
Note: See TracBrowser for help on using the repository browser.