repo: fmrl-client
action: commit
revision: 
path_from: 
revision_from: 986f7d23a70491b80db27a8006acf8aae01603d2:
path_to: 
revision_to: 
git.thebackupbox.net
fmrl-client
git clone git://git.thebackupbox.net/fmrl-client
commit 986f7d23a70491b80db27a8006acf8aae01603d2
Author: epoch 
Date:   Sun Dec 24 10:53:42 2023 -0600

    fmrl-get-contact-list updated to only try to get the last-changed time from the cache file if it actually exists

diff --git a/fmrl-get-contact-list b/fmrl-get-contact-list
index f45164eb3469a041d6da9ad8b1391dd42823451b..
index ..5e193ed0171a86c7e233da5193bb46b6980db544 100755
--- a/fmrl-get-contact-list
+++ b/fmrl-get-contact-list
@@ -4,8 +4,14 @@ me="$(cat ~/.config/fmrl-client/me)"
 fmrl-contacts-to-URIs | while read -r uri;do
   host="$(printf "%s\n" "$uri" | uricut -d)"
   host_cache_file=~/.cache/fmrl/"@${host}"
-  printf "uri: %s\n" "$uri" >&2
-  uricut <<< "$uri"
-  printf "host: %s\n" "$host" >&2
-  curl -H "Referer: ${me}" -H "If-Modified-Since: $(rfc7231date "$(stat -c '%Y' "${host_cache_file}")")" -g "$uri" -o "${host_cache_file}"
+  date > "${host_cache_file}.last_checked"
+  #printf "uri: %s\n" "$uri" >&2
+  #uricut <<< "$uri"
+  #printf "host: %s\n" "$host" >&2
+  echo "from uri: $uri" >&2
+  if [ -e "${host_cache_file}" ];then
+    curl -s -H "Referer: ${me}" -H "If-Modified-Since: $(rfc7231date "$(stat -c '%Y' "${host_cache_file}")")" -g "$uri" -o "${host_cache_file}"
+  else
+    curl -s -H "Referer: ${me}" -g "$uri" -o "${host_cache_file}"
+  fi
 done

-----END OF PAGE-----