openssl.sh 1.5 KB

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