Last active
May 1, 2021 17:56
-
-
Save jan-swiecki/c0b7107f438c700cb00f2c079056c3b0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -eou pipefail | |
VERSION="$2" | |
cd /tmp | |
set -x | |
# trap "rm $5" EXIT | |
rm SHA256SUM || true | |
checksums="$4" | |
bin="$3" | |
set +o pipefail | |
[ -f "$checksums" ] || wget "$1/$VERSION/$checksums" | |
[ -f "$bin" ] || wget "$1/$VERSION/$bin" | |
set -o pipefail | |
if [[ "$checksums" =~ \.asc$ ]]; then | |
gpg --verify "$checksums" "$bin" | |
else | |
cat "$checksums" | grep $bin >> SHA256SUM | |
sha256sum -c SHA256SUM | |
fi | |
if [ "$?" -ne 0 ]; then | |
echo "error: wrong sha25sum / gpg signature" >&2 | |
exit 1 | |
fi | |
if [[ "$bin" =~ \.zip$ ]]; then | |
unzip "$bin" | |
eval "$6" | |
else | |
chmod +x "$bin" | |
mv "$bin" "$HOME/.local/bin/$6" | |
fi | |
echo "success" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -eo pipefail | |
# https://jeremylong.github.io/DependencyCheck/dependency-check-ant/index.html | |
gpg --keyserver hkp://keys.gnupg.net --recv-keys F9514E84AE3708288374BBBE097586CFEA37F9A6 | |
version="6.1.6" | |
./_install_github_release \ | |
"https://github.com/jeremylong/DependencyCheck/releases/download" \ | |
"v${version}" \ | |
"dependency-check-${version}-release.zip" \ | |
"dependency-check-${version}-release.zip.asc" \ | |
"dependency-check*" \ | |
" | |
{ rm -rf $HOME/opt/dependency-check >/dev/null 2>&1 || true; } \ | |
&& mkdir -p $HOME/opt \ | |
&& mkdir -p $HOME/.local/bin \ | |
&& mv dependency-check $HOME/opt/dependency-check \ | |
&& ln -sf $HOME/opt/dependency-check/bin/dependency-check.sh $HOME/.local/bin/dependency-check | |
" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment