summaryrefslogtreecommitdiff
path: root/src/get.sh
diff options
context:
space:
mode:
authordavidovski <david@davidovski.xyz>2022-02-20 02:45:55 +0000
committerdavidovski <david@davidovski.xyz>2022-02-20 02:45:55 +0000
commit8f02115e50573be0a5c6653f2a4a2bb6d7459911 (patch)
treec1c8fb3335bf9f940abd6aae8b2713e4443319db /src/get.sh
parente5bc87ffc368799685b9c9bf0e01db35ee974540 (diff)
added file lookup
Diffstat (limited to 'src/get.sh')
-rwxr-xr-xsrc/get.sh31
1 files changed, 16 insertions, 15 deletions
diff --git a/src/get.sh b/src/get.sh
index a6821a1..3e23f78 100755
--- a/src/get.sh
+++ b/src/get.sh
@@ -78,7 +78,7 @@ download_packages () {
local output="${out_dir}/${checksum}.${package}.xipkg"
local output_info="${output}.info"
- if validate_checksum $output $checksum; then
+ if ${UNSAFE} || validate_checksum $output $checksum; then
${VERBOSE} && printf "${LIGHT_BLACK}skipping download for %s already exists with checksum %s${RESET}\n" $package $checksum
else
${VERBOSE} && printf "${LIGHT_BLACK}downloading $package from $url\n" $package $checksum
@@ -94,22 +94,23 @@ download_packages () {
wait_for_download $total_download ${outputs}
echo
- local i=0
- set -- $outputs
- for pkg_file in ${outputs}; do
+ if ! ${UNSAFE}; then
+ local i=0
+ set -- $outputs
+ for pkg_file in ${outputs}; do
- ${QUIET} || hbar -T "${LARGE_CIRCLE} validating downloads..." $i $#
-
- info_file="${pkg_file}.info"
- if ! validate_sig $pkg_file $info_file; then
- printf "${RED}Failed to verify signature for ${LIGHT_RED}%s${RED}\n" $(basename -s .xipkg $pkg_file)
- mv "$pkg_file" "${pkg_file}.invalid"
- else
- i=$((i+1))
- fi
- done
- ${QUIET} || hbar -t ${HBAR_COMPLETE} -T "${CHECKMARK} validated downloads" $i $#
+ ${QUIET} || hbar -T "${LARGE_CIRCLE} validating downloads..." $i $#
+ info_file="${pkg_file}.info"
+ if ! validate_sig $pkg_file $info_file; then
+ printf "${RED}Failed to verify signature for ${LIGHT_RED}%s${RED}\n" $(basename -s .xipkg $pkg_file)
+ mv "$pkg_file" "${pkg_file}.invalid"
+ else
+ i=$((i+1))
+ fi
+ done
+ ${QUIET} || hbar -t ${HBAR_COMPLETE} -T "${CHECKMARK} validated downloads" $i $#
+ fi
install $@
}