我有 BusyBox v1.23.2 多调用二进制文件。
带有简单的 tftp 客户端。
我需要检查与 tftp 服务器的连接以及那里文件的可访问性。
对于 ftp,它可能如下所示:
if wget -q -s $url; then
echo "found"
fi
tftp有可靠的解决方案吗?
附:我无法尝试下载该文件(文件太大)。
更新:我通过在 BusyBox 的源代码中添加 hack 解决了这个问题,它允许实现一个场景,如下所示:
"No.","Source","Destination","Info"
"1","192.168.0.8","192.168.0.6","Read Request, File: some_folder/file.txt, Transfer type: octet, blksize\\000=4096\\000, tsize\\000=0\\000"
"2","192.168.0.6","192.168.0.8","Option Acknowledgement, blksize\\000=4096\\000, tsize\\000=10094\\000"
"3","192.168.0.8","192.168.0.6","Error Code, Code: Not defined, Message: Connection checking"
最佳答案
我想这对你有用。
$ wget --spider http://henning.makholm.net/
Spider mode enabled. Check if remote file exists.
--2011-08-08 19:39:48-- http://henning.makholm.net/
Resolving henning.makholm.net (henning.makholm.net)... 85.81.19.235
Connecting to henning.makholm.net (henning.makholm.net)|85.81.19.235|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 9535 (9.3K) [text/html] <-------------------------
Remote file exists and could contain further links,
but recursion is disabled -- not retrieving.
关于linux - 检查与 tftp 服务器的连接以及文件的可访问性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38013108/