最新消息:时间抓起来说是金子,抓不住就是流水。

shell 安装oracle和pfring(抓包) 及自动环境配置

Shell 镜花水月 6107浏览 0评论
#!/bin/bash
#luohongjiang
#qq:123769752
#version 1.1
oldpath=$(pwd)
var=${var-y}
echo -n "install orace(y/n):"
read var
if [[ $var == ‘y’ ]];then
{
rpm -qa |grep oracle
if (( $? >=1 ));then
{
rpm -ivh *.rpm
if [[ -e /usr/lib/oracle/11.1/client64/tnsnames.ora ]];then
:
else
echo -e "\E[31m no /usr/lib/oracle/11.1/client64/tnsnames.ora file \E[0m"
cp tnsnames.ora /usr/lib/oracle/11.1/client64/
fi

echo 'export TNS_ADMIN=/usr/lib/oracle/11.1/client64'>>/etc/profile
echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/oracle/11.1/client64:/usr/lib/oracle/11.1/client64/lib'>>/etc/profile
echo 'export ORACLE_HOME=/usr/lib/oracle/11.1/client64'>>/etc/profile
echo 'export PATH=$PATH:$ORACLE_HOME'>>/etc/profile
echo 'export NLS_LANG="SIMPLIFIED CHINESE_CHINA.ZHS16GBK"'>>/etc/profile

}
fi
if [[ ! -e sqlldr.zip ]];then
echo -e "\E[31m no file sqlldr.zip \E[0m"
else
# cp sqlldr.zip /usr/lib/oracle/11.1/client64/
# cd /usr/lib/oracle/11.1/client64/
unzip sqlldr.zip -d /usr/lib/oracle/11.1/client64/
fi
# cd $oldpath
}
fi

echo -n "install pfring(y/n):"
read var
var=${var-y}
if [ “$var” == “y” ];then
{

tar -xvf pfring.tar.gz
cd $oldpath/pfring/kernel/
make

clear
echo install….
make install
sleep 3

clear
echo rmmod modules..
rmmod pf_ring
insmod $oldpath/pfring/kernel/pf_ring.ko
sleep 3

cd $oldpath/pfring/userland
echo y|cp $oldpath/pfring/userland/libpcap-1.0.0-ring/bpf/net/bpf_filter.c $oldpath/pfring/userland/libpcap-1.0.0-ring
make
cd $oldpath/pfring/userland/lib

clear
echo install…
make install INSTDIR=/usr
echo "install ok"
}
fi
source /etc/profile

转载请注明:LINUX服务器运维架构技术分享 » shell 安装oracle和pfring(抓包) 及自动环境配置

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址