#!/bin/sh # this script will pull down the most recent zaptel/oslec src rpm # setup a build environment and then compile and install them. # Use this at your own risk!! clear echo "This will rebuild zaptel and oslec for new kernels" echo "Internet access is required for this to work." echo "You also take full responsability if this totally" echo "dorks up your trixbox system!! You have been warned" echo -n "Do you wish to continue:? " read answer case "$answer" in "n" | "N" ) exit ;; "y" |"Y" ) echo "You have chosen wisely" echo "removing the exclude=kernel- from the repos" echo "This will be replaced when done" mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak grep -iv exclude /etc/yum.repos.d/CentOS-Base.repo.bak > /etc/yum.repos.d/CentOS-Base.repo yum clean all yum -y install rpm-build kernel-devel-`uname -r` newt-devel ncurses-devel libusb-devel gcc cd /usr/src wget http://yum.trixbox.org/centos/5/SRPMS/oslec-0.1-23.1345.src.rpm wget http://yum.trixbox.org/centos/5/SRPMS/zaptel-1.4.12-1.src.rpm rpmbuild --rebuild --target "i686" oslec-0.1-23.1345.src.rpm rpm -Uvh --force /usr/src/redhat/RPMS/i686/oslec-* wait 5 echo "Stopping asterisk" /usr/sbin/amportal stop wait 5 echo "" echo "Stopping zaptel" /etc/init.d/zaptel stop wait 5 cd /usr/src rpmbuild --rebuild --target "i686" --with sangoma --with oslec zaptel-1.4.12-1.src.rpm rpm -Uvh --force /usr/src/redhat/RPMS/i686/zaptel-* rm /etc/yum.repos.d/CentOS-Base.repo mv /etc/yum.repos.d/CentOS-Base.repo.bak /etc/yum.repos.d/CentOS-Base.repo ;; * ) echo "invalid option" ;; esac