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

Last change on this file since 4503 was 4503, checked in by joamuran, 4 years ago

fixed dnsmasq restart

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
22eval $(n4d-vars getvalues INTERNAL_DOMAIN)
23eval $(n4d-vars getvalues HOSTNAME)
24
25case "$1" in
26    configure)
27        if dpkg --compare-versions "$2" lt 0.9.39; then
28
29               if [ "${INTERNAL_DOMAIN}" != "" ]; then
30
31                        NEW_ALIAS="cname=admin-center.${INTERNAL_DOMAIN}, ${HOSTNAME}.${INTERNAL_DOMAIN}";
32                        FOUND=`cat $CNAMEPATH | grep "${NEW_ALIAS}" | wc -l`
33       
34                        if [ ${FOUND} -eq 0 ]; then
35                            echo ${NEW_ALIAS} >> $CNAMEPATH
36                            systemctl restart dnsmasq
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.