~ubuntu-branches/ubuntu/dapper/asterisk/dapper-security

« back to all changes in this revision

Viewing changes to debian/postinst

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2006-05-18 10:21:06 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20060518102106-5vgpbtylsvr9jiu3
Tags: 1:1.2.7.1.dfsg-2ubuntu1
* Resynchronized with Debian, only Ubuntu changes:
  - debian/*.init:
    - create /var/run/ directory if necessary.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#! /bin/sh
2
 
 
3
 
set -e
4
 
 
5
 
# summary of how this script can be called:
6
 
#        * <postinst> `configure' <most-recently-configured-version>
7
 
#        * <old-postinst> `abort-upgrade' <new version>
8
 
#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
9
 
#          <new-version>
10
 
#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
11
 
#          <failed-install-package> <version> `removing'
12
 
#          <conflicting-package> <version>
13
 
 
14
 
case "$1" in
15
 
    configure)
16
 
 
17
 
        if (getent passwd asterisk >/dev/null);then
18
 
                if [ "`getent passwd asterisk|awk -F: '{print $6}'`" = "/var/run/asterisk" ];then
19
 
                        usermod -d /var/lib/asterisk asterisk
20
 
                fi
21
 
        else
22
 
                adduser --system --group --home /var/lib/asterisk --gecos "Asterisk PBX daemon" asterisk
23
 
                adduser asterisk audio 
24
 
                adduser asterisk dialout
25
 
        fi
26
 
        if (groups asterisk | grep -w -q -v asterisk); then
27
 
                adduser asterisk dialout
28
 
        fi
29
 
 
30
 
        test -d /var/log/asterisk/cdr-csv || mkdir -p /var/log/asterisk/cdr-csv
31
 
        test -d /var/spool/asterisk || mkdir -p /var/spool/asterisk
32
 
        test -d /var/lib/asterisk || mkdir -p /var/lib/asterisk
33
 
        test -d /etc/asterisk || mkdir -p /etc/asterisk
34
 
        chown -R asterisk.asterisk /var/log/asterisk /var/run/asterisk \
35
 
                /var/spool/asterisk /var/lib/asterisk /etc/asterisk 
36
 
        chmod 0660 /etc/asterisk/*.conf
37
 
 
38
 
        # doing web-vmail foo...
39
 
        chown asterisk.www-data /etc/asterisk/voicemail.conf
40
 
        chmod 0640 /etc/asterisk/voicemail.conf
41
 
 
42
 
    ;;
43
 
 
44
 
    abort-upgrade|abort-remove|abort-deconfigure)
45
 
 
46
 
    ;;
47
 
 
48
 
    *)
49
 
        echo "postinst called with unknown argument \`$1'" >&2
50
 
        exit 1
51
 
    ;;
52
 
esac
53
 
 
54
 
# dh_installdeb will replace this with shell code automatically
55
 
# generated by other debhelper scripts.
56
 
 
57
 
#DEBHELPER#
58
 
 
59
 
exit 0
60
 
 
61