偶喜欢脚本,维护40多个分校的呼叫中心,如果全手动来搞,偶疯掉啦 #!/bin/sh #脚本名称:asterisk_rebuild.sh #作者:张拓 #日期:2009-9-22 #用途:重新编译安装asterisk 1.4.21.1 #使用方法:将该脚本传到服务器任意目录中,赋予执行的权限chmod a+x asterisk_rebuild.sh 然后执行之 ./asterisk_rebuild.sh echo "=============== begin upgrade ==============" echo "=============== Download asterisk-1.4.21.1.tar.gz ==============" killall -9 safe_asterisk killall -9 asterisk modprobe -r opvxa1200 d=`date +%Y%m%d%H%M%S` mv /etc/asterisk /etc/asterisk_bak_$d mv /etc/zaptel.conf /etc/zaptel.conf_bak_$d mv /var/log/asterisk /var/log/asterisk_bak_$d mv /var/lib/asterisk /var/lib/asterisk_bak_$d mv /var/spool/asterisk /var/spool/asterisk_bak_$d mv /usr/lib/asterisk /usr/lib/asterisk_bak_$d cd /usr/src/ wget http://yours_ip/asterisk-1.4.21.1.tar.gz tar xvf asterisk-1.4.21.1.tar.gz cd asterisk-1.4.21.1 ./configure make make install make samples cd /etc/asterisk/ rm -vf extensions.conf features.conf iax.conf sip.conf ln -s /var/www/html/admin/modules/core/etc/extensions.conf extensions.conf ln -s /var/www/html/admin/modules/core/etc/features.conf features.conf ln -s /var/www/html/admin/modules/core/etc/iax.conf iax.conf ln -s /var/www/html/admin/modules/core/etc/sip.conf sip.conf chown -v asterisk:asterisk * cp -Rv /var/lib/asterisk_bak_$d/sounds/custom /var/lib/asterisk/sounds/ cd .. rm -rvf asterisk-1.4.21.1.tar.gz rm -rvf asterisk-1.4.21.1 echo "=============== All is Ok ==============" 注:我把asterisk-1.4.21.1.tar.gz包放到了偶的web服务器上了