summaryrefslogtreecommitdiff
path: root/social/asterisk/asterisk.install
diff options
context:
space:
mode:
authorNicolás Reynolds <apoyosis@correo.inta.gob.ar>2011-10-23 04:57:38 -0300
committerNicolás Reynolds <apoyosis@correo.inta.gob.ar>2011-10-23 04:57:38 -0300
commitdb83c17ba25c263db80a7999254a255b14ef0e37 (patch)
tree8825488946334cc194a8490ad7944218fe3896a9 /social/asterisk/asterisk.install
parent128fec48de2a334c7af257ce0efe3315e5055ba6 (diff)
social/{asterisk,dropbear,openswan,poco,sipwitch,spectrum,ucommon}
Diffstat (limited to 'social/asterisk/asterisk.install')
-rw-r--r--social/asterisk/asterisk.install38
1 files changed, 38 insertions, 0 deletions
diff --git a/social/asterisk/asterisk.install b/social/asterisk/asterisk.install
new file mode 100644
index 000000000..1a3b998b7
--- /dev/null
+++ b/social/asterisk/asterisk.install
@@ -0,0 +1,38 @@
+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
+>>> To get the postgresql, unixodbc or sqlite2 modules working
+>>> 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."
+}
+op=$1
+shift
+$op $*