diff options
author | Phillip Berndt <pberndt@spline.de> | 2013-09-10 10:18:50 +0200 |
---|---|---|
committer | Phillip Berndt <pberndt@spline.de> | 2013-09-10 10:18:50 +0200 |
commit | 0725aff23cd2d3876c8fa48adff8e59f9021b74f (patch) | |
tree | 4287209b29df84d48e56834e153fc8db54777aa0 | |
parent | 5afde763a0e72e82adca82180114545d8c44f02f (diff) | |
download | comics-0725aff23cd2d3876c8fa48adff8e59f9021b74f.tar.gz comics-0725aff23cd2d3876c8fa48adff8e59f9021b74f.tar.bz2 comics-0725aff23cd2d3876c8fa48adff8e59f9021b74f.zip |
Only change the index.html symlink if $daysago is 0
-rwxr-xr-x | bin/get-comics | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/bin/get-comics b/bin/get-comics index f959a6e..3b2a368 100755 --- a/bin/get-comics +++ b/bin/get-comics @@ -38,7 +38,9 @@ else ${top}/bin/gen.py "${daysago}" >> ${top}/log/gen-html.log 2>&1 fi -relativ_path="$(date +sites/%Y/%m/%d.html --date "$daysago days ago")" -if [ -f "${top}/htdocs/${relativ_path}" ]; then - ln -sf "${relativ_path}" "${top}/htdocs/index.html" +if [ "$daysago" = "0" ]; then + relativ_path="$(date +sites/%Y/%m/%d.html --date "$daysago days ago")" + if [ -f "${top}/htdocs/${relativ_path}" ]; then + ln -sf "${relativ_path}" "${top}/htdocs/index.html" + fi fi |