From 1b03164a319ce5d183955532cfd63c396d51d73d Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Wed, 25 Jun 2025 22:28:04 +0300 Subject: [PATCH] Skip downloading existing pictures --- .local/bin/get-nasa-apod | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.local/bin/get-nasa-apod b/.local/bin/get-nasa-apod index 2f68b97..e6560b9 100755 --- a/.local/bin/get-nasa-apod +++ b/.local/bin/get-nasa-apod @@ -21,6 +21,11 @@ extension="${picture_url##*.}" filename="${picture_date}.${extension}" outfile="${WALLPAPERS}/${filename}" +if [ -f "${outfile}" ]; then + echo "Target file already exists" + exit 0 +fi + tempfile="$(mktemp)" curl \ --location \