Line | |
---|
1 | #!/bin/sh |
---|
2 | set -e |
---|
3 | # N4D module must be enabled to make more easier |
---|
4 | # the installation process |
---|
5 | #dconf update |
---|
6 | |
---|
7 | case $1 in |
---|
8 | configure) |
---|
9 | if [ "$2" != "" ] ; then |
---|
10 | if dpkg --compare-versions $2 lt 0.14 |
---|
11 | then |
---|
12 | cp /usr/share/lliurex-lab/one-shot/* /etc/n4d/one-shot/ |
---|
13 | deb-systemd-invoke restart n4d || true |
---|
14 | fi |
---|
15 | fi |
---|
16 | if [ -e /usr/share/apache2/apache2-maintscript-helper ] ; then |
---|
17 | . /usr/share/apache2/apache2-maintscript-helper |
---|
18 | apache2_invoke ensite lliurexlab |
---|
19 | fi |
---|
20 | |
---|
21 | invoke-rc.d apache2 reload || true |
---|
22 | |
---|
23 | |
---|
24 | |
---|
25 | |
---|
26 | if dpkg --compare-versions "$2" lt 0.9 ;then |
---|
27 | |
---|
28 | CNAME="/var/lib/dnsmasq/config/cname-server" |
---|
29 | |
---|
30 | if [ -f $CNAME ]; then |
---|
31 | |
---|
32 | DOMAIN=$(n4d-vars getvalues INTERNAL_DOMAIN | cut -d"'" -f2) |
---|
33 | SRVNAME=$(n4d-vars getvalues HOSTNAME | cut -d"'" -f2) |
---|
34 | echo "Fixing lliurexlab DNS ..." |
---|
35 | sed -i -e "/^cname=lliurexlab.*/d" $CNAME |
---|
36 | sed -i -e "/^$/d" $CNAME |
---|
37 | echo "\ncname=lliurexlab.$DOMAIN,$SRVNAME.$DOMAIN\n" >> $CNAME |
---|
38 | |
---|
39 | invoke-rc.d dnsmasq restart || true |
---|
40 | |
---|
41 | fi |
---|
42 | |
---|
43 | fi |
---|
44 | |
---|
45 | # |
---|
46 | |
---|
47 | #if [ ! -f /var/lib/dnsmasq/config/cname-lliurex-guard ]; then |
---|
48 | # echo "cname=lliurexlab.$DOMINI,$SRVNAME.$DOMINI" > /var/lib/dnsmasq/config/cname-lliurexlab |
---|
49 | # service dnsmasq restart |
---|
50 | #fi |
---|
51 | |
---|
52 | |
---|
53 | ;; |
---|
54 | *) |
---|
55 | echo "[DEBUG] Unknow action ..." |
---|
56 | ;; |
---|
57 | esac |
---|
58 | |
---|
59 | #DEBHELPER# |
---|
60 | |
---|
61 | exit 0 |
---|
62 | |
---|
63 | |
---|
Note: See
TracBrowser
for help on using the repository browser.