source: python-llxvars/trunk/fuentes/debian/postinst @ 4507

Last change on this file since 4507 was 4507, checked in by joamuran, 3 years ago

fixed postinst

File size: 1.5 KB
Line 
1#!/bin/sh
2# postinst script for python-llxvars
3#
4# see: dh_installdeb(1)
5
6set -e
7
8# summary of how this script can be called:
9#        * <postinst> `configure' <most-recently-configured-version>
10#        * <old-postinst> `abort-upgrade' <new version>
11#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
12#          <new-version>
13#        * <postinst> `abort-remove'
14#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
15#          <failed-install-package> <version> `removing'
16#          <conflicting-package> <version>
17# for details, see http://www.debian.org/doc/debian-policy/ or
18# the debian-policy package
19
20CNAMEPATH="/var/lib/dnsmasq/config/cname-server"
21
22echo "Performing postinstall"
23
24eval $(n4d-vars getvalues INTERNAL_DOMAIN)
25eval $(n4d-vars getvalues HOSTNAME)
26
27case "$1" in
28    configure)
29        if dpkg --compare-versions "$2" lt 0.9.40; then
30
31               if [ "${INTERNAL_DOMAIN}" != "" ]; then
32
33                        NEW_ALIAS="cname=admin-center.${INTERNAL_DOMAIN}, ${HOSTNAME}.${INTERNAL_DOMAIN}";
34                        FOUND=`cat $CNAMEPATH | grep "${NEW_ALIAS}" | wc -l`
35       
36                        if [ ${FOUND} -eq 0 ]; then
37                            echo ${NEW_ALIAS} >> $CNAMEPATH
38                            systemctl restart dnsmasq
39                        fi
40                fi
41
42        fi
43
44
45
46        ;;
47
48
49
50    abort-upgrade|abort-remove|abort-deconfigure)
51    ;;
52
53    *)
54        echo "postinst called with unknown argument \`$1'" >&2
55        exit 1
56    ;;
57esac
58
59# dh_installdeb will replace this with shell code automatically
60# generated by other debhelper scripts.
61
62#DEBHELPER#
63
64exit 0
Note: See TracBrowser for help on using the repository browser.