rendered paste body#!/bin/shecho "-------------------------------------------"echo "Rebuilding zaptel drivers"echo "-------------------------------------------"amportal stop/etc/init.d/zaptel stopecho "-------------------------------------------"echo "Kernel setup"echo "-------------------------------------------"SOURCE_DIRECTORY=/usr/srcKERNEL_VERSION=`uname -r`MODULES_DIRECTORY=/lib/modules/$KERNEL_VERSION/extraif [ Psmp = P`uname -r|grep -o smp` ]then KERNEL_DIRECTORY=${KERNEL_VERSION%%smp}-smp-`uname -m` KERNEL_CPU=smpelse KERNEL_DIRECTORY=$KERNEL_VERSION-`uname -m` KERNEL_CPU=onefiecho -e "Kernel version:\t\t$KERNEL_VERSION"echo -e "Kernel directory:\t$KERNEL_DIRECTORY"echo -e "Modules directory:\t$MODULES_DIRECTORY"# check that the kernel libraries for the currently running kernel are present# if not try and install or update themecho ""echo "-----------------------------------------------------"echo "Seting up links to kernel sources"echo "-----------------------------------------------------"echo ""### If the links exist, remove them in case they are pointing to another version of the kernel.if [ -d /usr/src/linux/ ]then rm -f /usr/src/linuxfiln -s $SOURCE_DIRECTORY/kernels/$KERNEL_DIRECTORY /usr/src/linuxecho -e "Link linux:\t\t`ls -l linux`"if [ -d /usr/src/linux-2.6/ ]then rm -f /usr/src/linux-2.6filn -s $SOURCE_DIRECTORY/kernels/$KERNEL_DIRECTORY /usr/src/linux-2.6echo -e "Link linux-2.6:\t\t`ls -l linux-2.6`"cd /usr/src/zaptelmake install-udevmake cleanmake linux26make zttoolmake install/etc/init.d/zaptel startamportal startecho "Done."