Always download when called

This commit is contained in:
斟酌 鵬兄 2023-10-08 01:51:13 +08:00
parent d4ce0501a1
commit f13fe397b6

View File

@ -302,20 +302,17 @@ function kstore-dl-s3au {
_CSUM=$1
_NAME=$2
which "$_NAME" > /dev/null 2>&1
if [ $? -ne 0 ]; then
tmp=$( mktemp )
__download "$p/$_NAME" > $tmp
sha256sum $tmp | grep -q "$_CSUM"
if [ $? -eq 0 ]; then
_NAME=$( basename "${_NAME//_/-}" .sh )
mv $tmp "$RBASH_BIN/$_NAME"
chmod +x "$RBASH_BIN/$_NAME"
echo "> $RBASH_BIN/$_NAME"
else
echo "$_NAME: Signature mismatch"
return 1
fi
tmp=$( mktemp )
__download "$p/$_NAME" > $tmp
sha256sum $tmp | grep -q "$_CSUM"
if [ $? -eq 0 ]; then
_NAME=$( basename "${_NAME//_/-}" .sh )
mv $tmp "$RBASH_BIN/$_NAME"
chmod +x "$RBASH_BIN/$_NAME"
echo "> $RBASH_BIN/$_NAME"
else
echo "$_NAME: Signature mismatch"
return 1
fi
}