#!/bin/bash
KERNEL=`rpm -qa |grep kernel-smp-devel-2.6.9-67.EL >/dev/null ; echo $?`
alias cp='cp -i'
unalias cp
if [ $KERNEL -eq 1 ] ; then
rpm -ivh kernel-smp-devel-2.6.9-67.EL.i686.rpm
fi
SWCSMDIR=`cd /lib/swcsmdrv 2>/dev/null ; echo $?`
if [ $SWCSMDIR -eq 1 ] ; then
mkdir /lib/swcsmdrv
cp driver26x/loaddrv driver26x/swcsm09.ko /lib/swcsmdrv/
cp swmmg/libswsds.so.2.5.0.0 /lib/libswsds.so
cd /lib/swcsmdrv/ ; ./loaddrv
fi
LSMOD=`lsmod |grep swcsm09 >/dev/null ; echo $?`
if [ $LSMOD -eq 0 ] ; then
echo swcsm09 Loading success
else
echo error swcsm09 Loading not successful
fi
JAVADIR=`cd /usr/java/jre1.6.0_13/lib/security 2>/dev/null ; echo $?`
if [ $JAVADIR -eq 0 ] ; then
cp java.security /usr/java/jre1.6.0_13/lib/security
cp SwxaJCE.jar /usr/java/jre1.6.0_13/lib/ext/
cp local_policy.jar /usr/java/jre1.6.0_13/lib/security/
cp US_export_policy.jar /usr/java/jre1.6.0_13/lib/security/
cp libswsds.so.2.5.0.0 /lib/
cp libdevice.so /lib
cp libstdc++.so.5 /usr/lib
cp sm3.jar /usr/java/
cp profile /etc/profile
source /etc/profile
echo Driver installation is complete
fi
cp rc.local /etc
LOCALFILE=`grep "cd /lib/swcsmdrv ; ./loaddrv " /etc/rc.local >/dev/null ; echo $?`
if [ $LOCALFILE -eq 1 ] ; then
sed -i '/touch/a\cd /lib/swcsmdrv ; ./loaddrv ' /etc/rc.local
KERNEL=`rpm -qa |grep kernel-smp-devel-2.6.9-67.EL >/dev/null ; echo $?`
alias cp='cp -i'
unalias cp
if [ $KERNEL -eq 1 ] ; then
rpm -ivh kernel-smp-devel-2.6.9-67.EL.i686.rpm
fi
SWCSMDIR=`cd /lib/swcsmdrv 2>/dev/null ; echo $?`
if [ $SWCSMDIR -eq 1 ] ; then
mkdir /lib/swcsmdrv
cp driver26x/loaddrv driver26x/swcsm09.ko /lib/swcsmdrv/
cp swmmg/libswsds.so.2.5.0.0 /lib/libswsds.so
cd /lib/swcsmdrv/ ; ./loaddrv
fi
LSMOD=`lsmod |grep swcsm09 >/dev/null ; echo $?`
if [ $LSMOD -eq 0 ] ; then
echo swcsm09 Loading success
else
echo error swcsm09 Loading not successful
fi
JAVADIR=`cd /usr/java/jre1.6.0_13/lib/security 2>/dev/null ; echo $?`
if [ $JAVADIR -eq 0 ] ; then
cp java.security /usr/java/jre1.6.0_13/lib/security
cp SwxaJCE.jar /usr/java/jre1.6.0_13/lib/ext/
cp local_policy.jar /usr/java/jre1.6.0_13/lib/security/
cp US_export_policy.jar /usr/java/jre1.6.0_13/lib/security/
cp libswsds.so.2.5.0.0 /lib/
cp libdevice.so /lib
cp libstdc++.so.5 /usr/lib
cp sm3.jar /usr/java/
cp profile /etc/profile
source /etc/profile
echo Driver installation is complete
fi
cp rc.local /etc
LOCALFILE=`grep "cd /lib/swcsmdrv ; ./loaddrv " /etc/rc.local >/dev/null ; echo $?`
if [ $LOCALFILE -eq 1 ] ; then
sed -i '/touch/a\cd /lib/swcsmdrv ; ./loaddrv ' /etc/rc.local
fi
本文转自zhaoyun00 51CTO博客,原文链接:http://blog.51cto.com/zhaoyun/691322