openssl.sh 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. echo "${openssl_install_dir}/lib" > /etc/ld.so.conf.d/openssl.conf
  23. ldconfig
  24. rm -rf openssl-${openssl_version}
  25. else
  26. echo "${CFAILURE}openssl-1.0.2 install failed, Please contact the author! ${CEND}"
  27. kill -9 $$
  28. fi
  29. popd
  30. fi
  31. }
  32. Install_openSSL100() {
  33. if [ ! -e '/usr/local/openssl100s/lib/libcrypto.a' ]; then
  34. pushd ${oneinstack_dir}/src
  35. tar xzf openssl-1.0.0s.tar.gz
  36. pushd openssl-1.0.0s
  37. make clean
  38. ./config --prefix=/usr/local/openssl100s -fPIC shared zlib-dynamic
  39. make -j ${THREAD} && make install
  40. popd
  41. if [ -f "/usr/local/openssl100s/lib/libcrypto.a" ]; then
  42. echo "${CSUCCESS}openssl-1.0.0s module installed successfully! ${CEND}"
  43. rm -rf openssl-1.0.0s
  44. else
  45. echo "${CFAILURE}openssl-1.0.0s install failed, Please contact the author! ${CEND}"
  46. kill -9 $$
  47. fi
  48. popd
  49. fi
  50. }