2011-03-30 00:44:18 +00:00
|
|
|
post_install() {
|
|
|
|
echo -n "adding asterisk system group... "
|
|
|
|
groupadd -g 5060 asterisk && echo "done."
|
|
|
|
echo -n "adding asterisk system user... "
|
|
|
|
useradd -c "Asterisk daemon" -u 5060 -d /var/lib/asterisk -g asterisk -s /bin/false asterisk \
|
|
|
|
&& echo "done."
|
|
|
|
passwd -l asterisk &>/dev/null
|
|
|
|
chown -R asterisk:asterisk /var/run/asterisk
|
|
|
|
chown -R asterisk:asterisk /var/log/asterisk
|
|
|
|
chown -R asterisk:asterisk /var/spool/asterisk
|
|
|
|
chown -R asterisk:asterisk /var/lib/asterisk
|
|
|
|
|
|
|
|
cat << EOF
|
|
|
|
>>>
|
|
|
|
>>> To get Music on Hold working do pacman -S mpg123
|
2013-02-07 04:06:27 +00:00
|
|
|
>>> To get the postgresql, unixodbc or sqlite modules working
|
2011-03-30 00:44:18 +00:00
|
|
|
>>> download the respective package and modify modules.conf to reflect
|
|
|
|
>>> your changes.
|
|
|
|
>>>
|
|
|
|
EOF
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
post_upgrade() {
|
|
|
|
if grep asterisk /etc/passwd &>/dev/null; then
|
|
|
|
/bin/true
|
|
|
|
else
|
|
|
|
post_install $1
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
post_remove() {
|
|
|
|
echo -n -e "\nremoving asterisk system user... "
|
|
|
|
userdel asterisk && echo "done."
|
2013-04-15 03:42:15 +00:00
|
|
|
rm -f /etc/tmpdiles.d/asterisk.conf
|
2011-03-30 00:44:18 +00:00
|
|
|
}
|
|
|
|
op=$1
|
|
|
|
shift
|
|
|
|
$op $*
|