forked from Ubuntu-ve/lnmp
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathopenssl.sh
36 lines (35 loc) · 1.38 KB
/
openssl.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
# Author: yeho <lj2007331 AT gmail.com>
# BLOG: https://blog.linuxeye.com
#
# Notes: OneinStack for CentOS/RadHat 5+ Debian 6+ and Ubuntu 12+
#
# Project home page:
# https://oneinstack.com
# https://github.com/lj2007331/oneinstack
Install_openSSL102() {
if [ ! -e "${openssl_install_dir}/lib/libcrypto.a" ]; then
# install openssl-1.0.2
pushd ${oneinstack_dir}/src
tar xzf openssl-${openssl_version}.tar.gz
pushd openssl-${openssl_version}
make clean
./config --prefix=${openssl_install_dir} -fPIC shared zlib-dynamic
make -j ${THREAD} && make install
[ -z "`grep ^'export PATH=' /etc/profile`" ] && echo "export PATH=${openssl_install_dir}/bin:\$PATH" >> /etc/profile
[ -n "`grep ^'export PATH=' /etc/profile`" -a -z "`grep ${openssl_install_dir} /etc/profile`" ] && sed -i "s@^export PATH=\(.*\)@export PATH=${openssl_install_dir}/bin:\1@" /etc/profile
. /etc/profile
popd
if [ -f "${openssl_install_dir}/lib/libcrypto.a" ]; then
echo "${CSUCCESS}openssl-1.0.2 module installed successfully! ${CEND}"
/bin/cp cacert.pem ${openssl_install_dir}/ssl/cert.pem
echo "${openssl_install_dir}/lib" > /etc/ld.so.conf.d/openssl.conf
ldconfig
rm -rf openssl-${openssl_version}
else
echo "${CFAILURE}openssl-1.0.2 install failed, Please contact the author! ${CEND}"
kill -9 $$
fi
popd
fi
}