#!/bin/bash # (c) 2009 James Finstrom # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above # copyright notice, this list of conditions and the following disclaimer # in the documentation and/or other materials provided with the # distribution. # * Neither the name of the Rhino Equipment nor the names of its # contributors may be used to endorse or promote products derived from # this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # Date: 2009/08/14 # Title: install-sangoma # Purpose: Does the same thing (I hope) as the BMILL Script. I would fix his but # It is not well thought out and I don't know Python! #You can set this to 0 to get rifd of the welcome message! ADVERT=1 REPO4="http://yum.trixbox.org/centos/4/RPMS/" REPO5="http://yum.trixbox.org/centos/5/RPMS/" REPO28="http://yum.trixbox.org/trixbox/2.8/RPMS/" KERVER=$(uname -r) #This may be removed if you maintain this script elsewhere... if [ $ADVERT ]; then echo "==================================================" echo "This script should be considered experimental" echo "If you found this script useful please consider " echo "showing your support via the methods listed in the" echo "footer of http://dontcallmyboss.com" echo "or buying some Rhino hardware " echo "to support my future efforts. Thank YOU" echo "==================================================" echo "press any key to move on!" echo "==================================================" read -n1 foo fi ##Identify zaptel or DAHDI if [ "$(grep zaptel /proc/modules)" ]; then echo "Found Zaptel" IFACETYPE="ZAPTEL" fi if [ "$(grep dahdi /proc/modules)" ]; then echo "Found DAHDI" IFACETYPE="DAHDI" fi case "$KERN" in "2.6.18-92.1.18.el5") MODULEVER="3.3.15-0"; REPO="$REPO5"; ;; "2.6.18-53.1.4.el5") MODULEVER="3.2.6-0"; REPO="$REPO5"; ;; "2.6.9-34.0.2.ELsmp") MODULEVER="3.2.1-0"; REPO="$REPO4"; ;; "2.6.9-34.0.2.EL") MODULEVER="3.2.1-0"; REPO="$REPO4"; ;; "2.6.18-128.1.10.el5") if [ "$IFACETYPE" == "ZAPTEL"]; then MODULEVER="3.4.2.3"; REPO="$REPO5"; else MODULEVER="3.5.4.8"; REPO="$REPO28"; fi ;; *) echo "You appear to be running an unsupported kernel"; echo "You may wish to install by hand"; ;; esac mkdir -p /tmp/install-sangoma/ cd /tmp/install-sangoma wget -nv "${REPO}wanpipe-util-${MODULEVER}.i686.rpm" || echo "download wanpipe utils FAILED"; exit 1; wget -nv "${REPO}wanpipe-modules-${KERN}-${MODULEVER}.i686.rpm"|| echo "download wanpipe modules FAILED"; exit 1 rpm -i wanpipe-util*rpm || echo "install of wanpipe util FAILED"; exit 2; rpm -i wanpipe-mod*rpm || echo "install of wanpipe util FAILED"; exit 2; echo "Sangoma Wanpipe RPMs have been installed." echo "Please run setup-sangoma to configure your cards."