我想在bash中获取最新版本的openssl。基本上我想获得最新版本的curl和bash中的最新版本的下载链接。问题是, openssl在其github版本中不使用latest
标记。在bash中获取最新版本的openssl
回答
为了让你可以使用OpenSSL的FTP镜中的一个最新的OpenSSL存档。这是一个示例bash脚本。
#!/bin/bash
# An ftp mirror, see here https://www.openssl.org/source/mirror.html
mirror_url='ftp://gd.tuwien.ac.at/infosys/security/openssl/'
# Last modified date of source directory
last_modified=$(curl -s $mirror_url | awk '/source/{print $6,$7,$8}')
# OpenSSL archive with same modification Date as source dir
latest_archive=$(curl -s "$mirror_url"source/ | grep "$last_modified.*tar.gz$"|awk '{print $NF}')
# URL of latest release
latest_release=$mirror_url"source/"$latest_archive
# Download latest release
curl -sO "$latest_release"
很抱歉的reply.Your解决方案工作正常,但我想知道有时它可能会返回一个fss版本的openssl,如果它早些发布的话。你可以修改你的代码来排除openssl的fips版本,只是为了安全起见 – user2650277
你可以通过更具体的grep过滤掉fips字符串,尝试一些东西像这样:'grep“$ last_modified。* openssl- [0-9]。* tar.gz $”' – Zlemini
我想在1.0.2系列在bash以获得最新版本的OpenSSL ...
据我所知,击不使用OpenSSL。它也没有内置的下载工具或管理器,因此您需要使用外部命令,如curl
或wget
。
要执行下载,您需要访问OpenSSL download页面。然后,它的那样简单:
$ wget https://www.openssl.org/source/openssl-1.0.2j.tar.gz
--2016-11-25 10:00:22-- https://www.openssl.org/source/openssl-1.0.2j.tar.gz
Resolving www.openssl.org (www.openssl.org)... 23.6.16.135, ...
Connecting to www.openssl.org (www.openssl.org)|23.6.16.135|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 5307912 (5.1M) [application/x-gzip]
Saving to: ‘openssl-1.0.2j.tar.gz’
openssl-1.0.2j.tar. 100%[===================>] 5.06M 6.67MB/s in 0.8s
2016-11-25 10:00:23 (6.67 MB/s) - ‘openssl-1.0.2j.tar.gz’ saved [5307912/5307912]
$ tar xzf openssl-1.0.2j.tar.gz
$
您可以用类似的脚本吧:
#!/usr/bin/env bash
VERSIONS=(z y x w v u t s r q p o n m l k j i h g f e d c b a)
for v in ${VERSIONS[@]};
do
if [[ $(wget -S --spider https://www.openssl.org/source/openssl-1.0.2$v.tar.gz 2>&1 | grep 'HTTP/1.1 200 OK') ]];
then
if [[ ! $(wget https://www.openssl.org/source/openssl-1.0.2$v.tar.gz &>/dev/null) ]];
then
echo "Downloaded openssl-1.0.2$v.tar.gz"
else
echo "Failed to download openssl-1.0.2$v.tar.gz"
fi
break
fi
done
我感兴趣的只是最新版本here.Would提取网址从https://www.openssl.org/source/是一个更好的解决方案 – user2650277
- 1. Bash最新版本的Git?
- 2. 支持SSLv3的最新OpenSSL版本
- 3. 如何确定最新的OpenSSL版本
- 4. 如何在.inputrc中获取Bash版本
- 5. 获取最新的稳定版本git
- 6. 获取产品的最新版本
- 7. 如何获取最新的RStudio版本
- 8. 获取最新版本的GCC并提升最新版本的Ubuntu
- 9. 如何获取新版本的openssl以显示在我的phpinfo中
- 10. 的OpenSSL在bash脚本
- 11. 在Delphi中获取OpenSSL DLL的版本和/或位置?
- 12. 从svn获取最新版本号
- 13. 获取最新版本不起作用
- 14. 使用git获取最新版本
- 15. TFS获取最新版本历史
- 16. 获取最新版本两次(多次)
- 17. 使用nodegit获取最新版本
- 18. 使用TFS API获取最新版本
- 19. AnkhSVN在获取最新版本时未获取引用dll
- 20. 在指定最新版本时获取Puppet中包装的安装版本
- 21. 在MySQL中获取最新版本的记录
- 22. 如何在mysql中获取最新的行(post)修订版本?
- 23. Bash脚本读取'openssl help'的输出
- 24. 在OSX上更新OpenSSL版本
- 25. 在Artifactory中获取最新版本状态
- 26. OpenSSL版本apk
- 27. 使用最新版本的OpenSSL与Indy是否好?
- 28. 获取C#中Windows 10的最新版本操作系统#
- 29. 从数据库中获取最新版本的文章
- 30. 使用P4Eclipse获取Eclipse中所有项目的最新版本
这似乎并不像一个编程的问题,而是如何在一个Linux发行版 – Aserre
安装软件@Aserre我知道如何安装软件队友....但在代码中硬编码版本值是无效的因为每当新版本出来时我都要修改它。 – user2650277
总是不是'master'分支上的最新版本?你可以解析'git remote -v update'的输出以确保你是最新的 – Aserre