minor updates

jumpsmm7 2021-01-08 01:20:53 -05:00
parent ce19b16c95
commit 272ae0c549

@ -189,18 +189,19 @@ Update() {
if [ $response -ne 0 ]; then
echo -e "$ERROR Could not download file from '$DOWNLOAD_URL'" >&2
rm -Rf "${BASE_DIR}/${DNSCRYPT_TAR}"
[ -f "${BASE_DIR}/${DNSCRYPT_TAR}" ] && rm -Rf "${BASE_DIR}/${DNSCRYPT_TAR}"
return 1
fi
if [ -x "$(command -v minisign)" ]; then
download $BASE_DIR 644 "${DOWNLOAD_URL}".minisig
download $BASE_DIR 644 "${DOWNLOAD_URL}.minisig"
minisign -Vm "${BASE_DIR}/${DNSCRYPT_TAR}" -P "$DNSCRYPT_PUBLIC_KEY"
valid_file=$?
if [ $valid_file -ne 0 ]; then
echo -e "$ERROR Downloaded file has failed signature verification. Update aborted." >&2
rm -Rf "${BASE_DIR}/${DNSCRYPT_TAR}"
[ -f "${BASE_DIR}/${DNSCRYPT_TAR}" ] && rm -Rf "${BASE_DIR}/${DNSCRYPT_TAR}"
[ -f "${DOWNLOAD_URL}.minisig" ] && rm -Rf "${DOWNLOAD_URL}.minisig"
return 1
fi
else
@ -215,8 +216,9 @@ Update() {
Update-Resolv
updated_successfully=$?
rm -Rf ${BASE_DIR}/${DNSCRYPT_TAR} ${BASE_DIR}/${DNSCRYPT_ARCH_TAR}
[ -f "${BASE_DIR}/${DNSCRYPT_TAR}" ] && rm -Rf "${BASE_DIR}/${DNSCRYPT_TAR}"
[ -f "${BASE_DIR}/${DNSCRYPT_ARCH_TAR}" ] && rm -Rf "${BASE_DIR}/${DNSCRYPT_ARCH_TAR}"
[ -f "${DOWNLOAD_URL}.minisig" ] && rm -Rf "${DOWNLOAD_URL}.minisig"
if [ $updated_successfully -eq 0 ]; then
echo -e "$INFO DNSCrypt-proxy has been successfully updated!"
return 0