updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / asterisk16 / asterisk16.install
blob228b139deb738b3cbca3aa87c4c2e5ebc70b6143
1 # arg 1:  the new package version
2 post_install() {
3   echo -n "Adding asterisk system group..."
4   groupadd -g 77 asterisk && echo " done."
5   echo -n "Adding asterisk system user..."
6   useradd -c "Asterisk daemon" -u 77 -d /var/lib/asterisk -g asterisk -s /bin/false asterisk \
7   && echo " done."
8   passwd -l asterisk &>/dev/null
10   chown -R asterisk:asterisk /var/run/asterisk
11   chown -R asterisk:asterisk /var/log/asterisk
12   chown -R asterisk:asterisk /var/spool/asterisk
13   chown -R asterisk:asterisk /var/lib/asterisk 
15   udevadm control --reload-rules
17   cat << EOF
18 >>>
19 >>> To get Music on Hold working do pacman -S mpg123
20 >>> To get the postgresql, unixodbc or sqlite2 modules working
21 >>> download the respective package and modify modules.conf to reflect
22 >>> your changes.
23 >>>
24 EOF
27 # arg 1:  the new package version
28 # arg 2:  the old package version
29 post_upgrade() {
30   if grep '^asterisk:' /etc/passwd &>/dev/null; then 
31     chown -R asterisk:asterisk /var/run/asterisk
32     chown -R asterisk:asterisk /var/log/asterisk
33     chown -R asterisk:asterisk /var/spool/asterisk
34     chown -R asterisk:asterisk /var/lib/asterisk 
35   else
36     post_install "$1"
37   fi
40 # arg 1:  the old package version
41 post_remove() {
42   echo -n -e "\nRemoving asterisk system user..."
43   userdel asterisk && echo " done."
46 # vim:set ts=2 sw=2 et: