openssl.sh 1.5 KB

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