linux中shell自動升級openssl到openssl 1.0.1g

來源:互聯網
上載者:User

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

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.