summaryrefslogtreecommitdiff
path: root/social/asterisk/asterisk.install
blob: 1a3b998b7be0713463f6f77dab42c5db629411c9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
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 $*