source: npl/phone/asterisk/post.asterisk @ c5c522c

gcc484ntopperl-5.22
Last change on this file since c5c522c was c5c522c, checked in by Edwin Eefting <edwin@datux.nl>, 8 years ago

initial commit, transferred from cleaned syn3 svn tree

  • Property mode set to 100644
File size: 1.7 KB
RevLine 
[c5c522c]1#!/bin/bash
2svcstop /service/asterisk || exit 1
3
4#grouphack, httpd runs as nobody:nogroup
5#groupadd -f forces succes status
6#groupadd asterisk -f
7#useradd -g asterisk asterisk
8
9#remove old 1.4 stuff to prevent asterisk from loading the modules and crashing:
10removepkg /var/log/packages/asterisk-1.4* /var/log/packages/asterisk_addons-1.4.1* /var/log/packages/agx_asterisk_addons-* 2>/dev/null
11touch /var/log/packages/agx_asterisk_addons-9999-i386-9999 #prevent reinstall
12touch /var/log/packages/asterisk_addons-9999-i386-9999
13
14#aanmaken symlink
15if [ -d /etc/asterisk ]; then
16    rm -r /etc/asterisk || exit 1
17fi
18ln -s /home/system/asterisk /etc/asterisk || exit 1
19
20
21if [ ! -L /var/spool/asterisk ]; then
22    cd /var/spool/asterisk || exit 1
23    mv * /home/system/asterisk/spool || exit 1
24    rm -r /var/spool/asterisk || exit 1
25    ln -s /home/system/asterisk/spool /var/spool/asterisk || exit 1
26fi
27
28#create missing fax spool dir
29if [ ! -d /home/system/asterisk/spool/fax ]; then
30   mkdir -p /home/system/asterisk/spool/fax || exit 1
31fi
32
33if [ ! -e /home/system/asterisk/asterisk.conf ]; then
34 for i in /home/system/asterisk/*new; do
35 mv $i "${i/.new}"
36 done
37fi
38
39#1.4.25+ needs res_smdi for voicemail
40#sed 's/.*res_smdi.so.*//' -i /etc/asterisk/modules.conf || exit 1
41
42#permissies fixen
43chown -R nobody:nogroup /home/system/asterisk* /var/log/asterisk /var/run/asterisk /var/lib/asterisk || exit 1
44
45svc -du /service/snmpd || exit 1
46svcreset /service/asterisk || exit 1
47
48#Set asterisk resource check
49if ! crontab -l | grep syn3-asteriskresourcecheck; then
50        crontab -l > /tmp/$$.cron || exit 1
51        echo '* * * * * /sbin/syn3-asteriskresourcecheck' >> /tmp/$$.cron || exit 1
52        cat /tmp/$$.cron | crontab - || exit 1
53        rm /tmp/$$.cron
54fi
Note: See TracBrowser for help on using the repository browser.