Version 0.1.9 from FTP
[asterisk/asterisk.git] / contrib / scripts / addmailbox
1 #!/bin/sh
2 VMHOME=/var/spool/asterisk/vm
3 SNDHOME=/var/lib/asterisk/sounds
4 echo -n "Enter mailbox number: "
5 read mailbox
6 mkdir -p ${VMHOME}/${mailbox}
7 mkdir -p ${VMHOME}/${mailbox}/INBOX
8 cat ${SNDHOME}/vm-theperson.gsm > ${VMHOME}/${mailbox}/unavail.gsm
9 cat ${SNDHOME}/vm-theperson.gsm > ${VMHOME}/${mailbox}/busy.gsm
10 cat ${SNDHOME}/vm-extension.gsm > ${VMHOME}/${mailbox}/greet.gsm
11 nums=`echo $mailbox | sed 's/./ \0/g'`
12 for x in $nums; do
13         cat ${SNDHOME}/digits/${x}.gsm >> ${VMHOME}/${mailbox}/unavail.gsm
14         cat ${SNDHOME}/digits/${x}.gsm >> ${VMHOME}/${mailbox}/busy.gsm
15         cat ${SNDHOME}/digits/${x}.gsm >> ${VMHOME}/${mailbox}/greet.gsm
16 done
17
18 cat ${SNDHOME}/vm-isunavail.gsm >> ${VMHOME}/${mailbox}/unavail.gsm
19 cat ${SNDHOME}/vm-isonphone.gsm >> ${VMHOME}/${mailbox}/busy.gsm
20