Run chmod only on succesful updates

This commit is contained in:
deajan 2024-07-23 15:29:39 +02:00
parent 608b4f1eda
commit a9658bbfb1

View file

@ -26,15 +26,14 @@ for platform in "windows_386" "windows_amd64" "linux_arm" "linux_arm64" "linux_a
errors=true errors=true
else else
if [ -f "${restic_filename}.bz2" ]; then if [ -f "${restic_filename}.bz2" ]; then
bzip2 -d "${restic_filename}.bz2" bzip2 -d "${restic_filename}.bz2" && chmod +x "${restic_filename}"
chmod +x "${restic_filename}"
elif [ -f "${restic_filename}.zip" ]; then elif [ -f "${restic_filename}.zip" ]; then
unzip "${restic_filename}.zip" unzip "${restic_filename}.zip"
else else
echo "Archive ${restic_filename} not found" echo "Archive ${restic_filename} not found"
errors=true errors=true
fi fi
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "Failed to decompress ${restic_filename}.bz2" echo "Failed to decompress ${restic_filename}.bz2"
errors=true errors=true
fi fi