openssl.sh 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. #!/bin/bash
  2. # Author: yeho <lj2007331 AT gmail.com>
  3. # BLOG: https://blog.linuxeye.com
  4. #
  5. # Notes: OneinStack for CentOS/RadHat 5+ Debian 6+ and Ubuntu 12+
  6. #
  7. # Project home page:
  8. # https://oneinstack.com
  9. # https://github.com/lj2007331/oneinstack
  10. Install_openSSL102() {
  11. if [ ! -e "${openssl_install_dir}/lib/libcrypto.a" ]; then
  12. # install openssl-1.0.2
  13. pushd ${oneinstack_dir}/src
  14. tar xzf openssl-${openssl_version}.tar.gz
  15. pushd openssl-${openssl_version}
  16. make clean
  17. ./config --prefix=${openssl_install_dir} -fPIC shared zlib-dynamic
  18. make -j ${THREAD} && make install
  19. popd
  20. if [ -f "${openssl_install_dir}/lib/libcrypto.a" ]; then
  21. echo "${CSUCCESS}openssl-1.0.2 module installed successfully! ${CEND}"
  22. /bin/cp cacert.pem ${openssl_install_dir}/ssl/cert.pem
  23. echo "${openssl_install_dir}/lib" > /etc/ld.so.conf.d/openssl.conf
  24. ldconfig
  25. rm -rf openssl-${openssl_version}
  26. else
  27. echo "${CFAILURE}openssl-1.0.2 install failed, Please contact the author! ${CEND}"
  28. kill -9 $$
  29. fi
  30. popd
  31. fi
  32. }