系統: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