代码拉取完成,页面将自动刷新
#!/bin/bash
set -o pipefail
help() {
echo >&2 "Usage: $0 path/to/libc.so"
echo >&2 " OR $0 bid=<BUILD_ID>"
echo >&2 " OR $0 md5=<MD5>"
echo >&2 " OR $0 sha1=<SHA1>"
echo >&2 " OR $0 sha256=<SHA256>"
exit 2
}
if [[ $# != 1 ]]; then
help
fi
arg="$1"
if [ -f "$arg" ]; then
libc="$(readlink -f "$arg")"
fi
cd "$(dirname "$0")"
if [[ -f "$libc" ]]; then
arg="sha1=$(sha1sum "$libc" | awk '{print $1}')"
fi
case "$arg" in
bid=*)
hash="${arg#"bid="}"
tool="file"
regex="=$hash,"
;;
md5=*)
hash="${arg#"md5="}"
tool="md5sum"
regex="$hash "
;;
sha1=*)
hash="${arg#"sha1="}"
tool="sha1sum"
regex="$hash "
;;
sha256=*)
hash="${arg#"sha256="}"
tool="sha256sum"
regex="$hash "
;;
*)
help
esac
ls -1 db/*.so | xargs $tool | grep -- "$regex" | perl -n -e '/([^\/: ]+)\.so/&&print "$1\n"'
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。