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

Last change on this file since 4558 was 4558, checked in by hectorgh, 4 years ago

making sure cname file exists

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
20
21case "$1" in
22    configure)
23        if dpkg --compare-versions "$2" lt 0.9.40; then
24
25               eval $(n4d-vars getvalues INTERNAL_DOMAIN HOSTNAME)
26
27               if [ "${INTERNAL_DOMAIN}" != "" ]; then
28
29                        NEW_ALIAS="cname=admin-center.${INTERNAL_DOMAIN},${HOSTNAME}.${INTERNAL_DOMAIN}";
30                        CNAMEPATH="/var/lib/dnsmasq/config/cname-server"
31                        if [ -e $CNAMEPATH ]; then
32                                FOUND=`cat $CNAMEPATH | grep "admin-center" | wc -l`
33                                if [ ${FOUND} -eq 0 ]; then
34                                    echo ${NEW_ALIAS} >> $CNAMEPATH
35                                    systemctl restart dnsmasq || true
36                                fi
37                        fi
38                fi
39
40        fi
41
42
43
44        ;;
45
46
47
48    abort-upgrade|abort-remove|abort-deconfigure)
49    ;;
50
51    *)
52        echo "postinst called with unknown argument \`$1'" >&2
53        exit 1
54    ;;
55esac
56
57# dh_installdeb will replace this with shell code automatically
58# generated by other debhelper scripts.
59
60#DEBHELPER#
61
62exit 0
Note: See TracBrowser for help on using the repository browser.