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>
10
# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
11
# <failed-install-package> <version> `removing'
12
# <conflicting-package> <version>
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
22
adduser --system --group --home /var/lib/asterisk --gecos "Asterisk PBX daemon" asterisk
23
adduser asterisk audio
24
adduser asterisk dialout
26
if (groups asterisk | grep -w -q -v asterisk); then
27
adduser asterisk dialout
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
38
# doing web-vmail foo...
39
chown asterisk.www-data /etc/asterisk/voicemail.conf
40
chmod 0640 /etc/asterisk/voicemail.conf
44
abort-upgrade|abort-remove|abort-deconfigure)
49
echo "postinst called with unknown argument \`$1'" >&2
54
# dh_installdeb will replace this with shell code automatically
55
# generated by other debhelper scripts.