gtxyzz

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

gtxyzz linux 2023-01-25 425浏览 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技术 的文章
发表评论