#!/bin/bash # Copyright (c) 2008, RHINO EQUIPMENT CORP # All rights reserved. # # Author: James Finstrom # Date: 04-29-08 # Name: setup-rhino-se (source edition) # Version 1.0 # Purpose: Install Rhino Kernel Modules from source assuming dependencies are in place # # # 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 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. DEBUG=0 cd /usr/src echo "---------------------------------------" echo "Backing up current rhino sources if any" echo " File will be /usr/src/rhino.$$.tbz2" echo "---------------------------------------" if [ "`find . -name "rhino*"`" ]; then if [ "$DEBUG" = "1" ]; then tar -cjvf rhino.$$.tbz2 rhino* else tar -cjf rhino.$$.tbz2 rhino* fi fi echo "---------------------------------------" echo " Grabbing the latest Source " echo "---------------------------------------" rm -rf rhino if [ "$DEBUG" = "1" ]; then curl http://dist.rhinoequipment.com/source | tar -xjv else curl ftp://ftp.rhinoequipment.com/Drivers/Beta/rhino-2.2.5.3.tbz2 | tar -xj fi for i in `find . -name "rhino*"`; do if [ -d $i ]; then mv $i ${i%-*} fi done echo "---------------------------------------" echo " Build and install Source " echo "---------------------------------------" cd rhino if [ "$DEBUG" = "1" ]; then make make install else export SKIPWAIT=1 make make install install -m 644 /usr/src/rhino/rcbfx.fw /lib/firmware export SKIPWAIT= fi depmod -a echo "---------------------------------------" echo " Grabbing modprobe file " echo "---------------------------------------" wget ftp://ftp.rhinoequipment.com/Drivers/Contrib/modprobe.rhino -O /etc/modprobe.d/modprobe.rhino clear echo "---------------------------------------" echo " Rhino Modules Installed " echo "---------------------------------------" echo "Rhino has installed the appropriate RPM for your system" echo "You shoulld be able to run setup-pstn and restart asterisk" echo "You can see the channel assignments by running cat /proc/zaptel/*" echo "If you have an analog/digital mixed enviroment you will want to load" echo "the modules from /etc/rc.local. If you have analog only you can simply" echo "uncomment the rcbfx line in /etc/sysconfig/zaptel to ensure" echo " the module loads at boot." echo "You can adjust module parameters in /etc/modprobe.conf or on CENTOS5 systems" echo "/etc/modprobe.d/modprobe.rhino" echo "Thank you for choosing Rhino Equipment" echo "----------------------------------------" exit 0