一聚教程网:一个值得你收藏的教程网站

热门教程

linux中shell自动升级openssl到openssl 1.0.1g

时间:2022-11-14 22:08:06 编辑:袖梨 来源:一聚教程网

系统:centos 5.x
openssl升级脚本内容:
cat openssl_update.sh

代码如下 复制代码

#!/bin/bash
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root" 1>&2
exit 1
fi
yum -y install glibc* cpp gcc* make zlib ntp wget
ntpdate time.nist.gov
hwclock -w
wget http://www.openssl.org/source/openssl-1.0.1g.tar.gz
file=`find / -name openssl-1.0.1g.tar.gz|wc -l`
if [[ $file = 1 ]];then
tar zxf openssl-1.0.1g.tar.gz && cd openssl-1.0.1g
./config shared zlib
#./config --prefix=/usr/local/ssl shared zlib-dynamic enable-camellia -DOPENSSL_NO_HEARTBEATS
make && make install
cd /usr/local/ssl/
./bin/openssl version
mv /usr/bin/openssl /usr/bin/openssl.old
mv /usr/include/openssl /usr/include/openssl.old
ln -s /usr/local/ssl/bin/openssl /usr/bin/openssl
ln -s /usr/local/ssl/include/openssl/ /usr/include/openssl
echo "/usr/local/ssl/lib" >> /etc/ld.so.conf
ldconfig
ldconfig -v|grep ssl
else
echo "file is not found!"
exit 1
fi

这样如果有多台(小于等于30台)服务器的话,你就可以传上去让脚本自己跑去,下次再加上批量分发和批量执行脚本就完美了.

感谢夜空 原文来自 http://blog.slogra.com/post-532.html

热门栏目