File: aolserver.postinst

package info (click to toggle)
aolserver 3.4.2-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 22,692 kB
  • ctags: 33,612
  • sloc: ansic: 171,340; tcl: 10,218; sh: 3,821; cpp: 2,779; makefile: 2,041; yacc: 1,648; perl: 456; php: 13
file content (77 lines) | stat: -rw-r--r-- 2,268 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#! /bin/sh -e
# postinst script for aolserver
#
# see: dh_installdeb(1)
# summary of how this script can be called:
#        * <postinst> `configure' <most-recently-configured-version>
#        * <old-postinst> `abort-upgrade' <new version>
#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
#          <new-version>
#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
#          <failed-install-package> <version> `removing'
#          <conflicting-package> <version>
# for details, see /usr/doc/packaging-manual/
#
# quoting from the policy:
#     Any necessary prompting should almost always be confined to the
#     post-installation script, and should be protected with a conditional
#     so that unnecessary prompting doesn't happen if a package's
#     installation fails and the `postinst' is called with `abort-upgrade',
#     `abort-remove' or `abort-deconfigure'.

if [ "$1" != "configure" ]
then
    exit 0
fi

if [ "$2" = "" ]
then
    ln -sf /usr/share/doc /var/www/doc

    . /usr/share/debconf/confmodule
    db_get aolserver/domain_name
    SERVERNAME=$RET
    db_get aolserver/port_num
    PORTNUM=$RET
    db_get aolserver/admin_name
    ADMINNAME=$RET
    db_get aolserver/group_name
    GROUPNAME=$RET
    db_get aolserver/doc_root
    DOCROOT=$RET
    
    db_stop

    # Update ownerships status
    chown -R $ADMINNAME.www-data /var/log/aolserver
    chown -R $ADMINNAME.www-data /var/run/aolserver

    if grep assert-perl /usr/sbin/aolsrvconfig > /dev/null 2>&1 \
       && /usr/sbin/aolsrvconfig --assert-perl > /dev/null 2>&1
    then
        if ! /usr/sbin/aolsrvconfig $CONFFLAGS --domain $SERVERNAME \
		--serveradmin $ADMINNAME --documentroot $DOCROOT \
		--port $PORTNUM --noninteract
        then
	    echo
	    echo -n "Configuration failed!  "
	    echo "Run \"aolsrvconfig\" to try this again later."
	    echo
        fi
    else
        echo
        echo ERROR: aolsrvconfig could not be run.  It may be the wrong
        echo version, or perl may not be fully configured yet.  When
        echo fixed, run \"dpkg --configure aolserver\" or \"aolsrvconfig\".
        echo
        echo -n "Press Enter to continue: "
        read REPLY
        echo
        exit 1;
    fi
fi

#DEBHELPER#