summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xpublish-purge9
1 files changed, 8 insertions, 1 deletions
diff --git a/publish-purge b/publish-purge
index ea65755..0be0fd7 100755
--- a/publish-purge
+++ b/publish-purge
@@ -57,7 +57,14 @@ cleanit()
d=$(readlink -f -- "$d")
if [ -e "$d/.publish.ttl" ]; then
- ttl="$(cat "$d/.publish.ttl")"
+ local newttl
+ newttl="$(cat "$d/.publish.ttl")"
+ if [ "$newttl" -eq "$newttl" ] 2>/dev/null; then
+ # if it is a number
+ ttl="$newttl"
+ else
+ [ "$optVerbose" -ge "1" ] && echo "Ignoring invalid TTL setting '$newttl' in $d"
+ fi
fi
if test_if_ancient "$d" "$ttl"; then