- 论坛徽章:
- 0
|
如果有问题欢迎在这留言:http://blog.chinaunix.net/u1/40306/showart_1359724.html
下边还有个word的文档内容在那,我去年写的今天整理一下发上了的,更详细内容请下载word文档
#--------------------------------------------------------------------------------------------------------------------------
- #!/bin/bash
- #wds
- #2007.12.6
- clear
- echo "Please wait ................................"
- kernel=$(uname -r)
- version=$(echo $kernel | cut -d. -f2)
- if [ "$version" -eq 6 ]
- then
- dir_down=$(pwd);
- dir=$(pwd)/src
- linux_bz2=$(ls linux-* | awk -F".tar" '{print $1}');
- iptables_bz2=$(ls iptables-* | awk -F".tar" '{print $1}');
- patch_bz2=$(ls patch-o-matic-ng-* | awk -F".tar" '{print $1}');
- netfilter_bz2=$(ls netfilter-* | awk -F".tar" '{print $1}');
- #-----------------------------------------------------------------------------------------------
- export KERNEL_DIR=$dir/$linux_bz2;
- export IPTABLES_DIR=$dir/$iptables_bz2;
- export PATCH_O_MATIC_NG=$dir/$patch_bz2;
- #------------------------------------------------------------------------------------------------
- [ ! -e /$dir ] && mkdir -p $dir
- [ ! -e /$dir/$linux_bz2 ] && tar -jxf ${linux_bz2}.tar.bz2 -C $dir
- [ ! -e /$dir/$iptables_bz2 ] && tar -jxf ${iptables_bz2}.tar.bz2 -C $dir
- [ ! -e /$dir/$netfilter_bz2 ] && tar -zxf ${netfilter_bz2}.tar.gz -C $dir
- [ ! -e /$dir/$patch_bz2 ] && tar -jxf ${patch_bz2}.tar.bz2 -C $dir
- #-update-kernel-----------------------------------------------------------------------------------
- cd $dir/$linux_bz2
- patch -p1 <../$netfilter_bz2/kernel-2.6.13-2.6.16-layer7-2.2.patch > /dev/null
- wait
- #-update-iptables---------------------------------------------------------------------------------
- cd $dir/$iptables_bz2
- patch -p1 <../$netfilter_bz2/iptables-layer7-2.2.patch > /dev/null
- wait
- #-update-patch----------------------------------------------------------------------------------------------
- cd $dir/$patch_bz2
- echo "y" | ./runme ipp2p
- wait
- echo "y" | ./runme time
- wait
- echo "y" | ./runme connlimit
- wait
- echo "y" | ./runme random
- wait
- #-make-kernel----------------------------------------------------------------------------------------c
- cd $dir/$linux_bz2
- echo "`pwd` is you address:"
- else
- echo "you kernel is not supper"
- fi
复制代码
[ 本帖最后由 7717060 于 2008-11-5 14:21 编辑 ] |
|