diff --git a/2minNoods.sh b/2minNoods.sh index d53c147..e666dc9 100755 --- a/2minNoods.sh +++ b/2minNoods.sh @@ -7,7 +7,7 @@ noodspp=40 mkdir -p "$siteroot/img/thumbs" pageno=1 noodcount=1 - +photolist="$(mktemp --suffix='.txt')" # html and css stolen from https://perfectmotherfuckingwebsite.com/ pageheader=''' @@ -57,13 +57,14 @@ a.button{

2minNoods

-
''' +
+''' rm -v "$siteroot"/index.*.html echo '' > "$siteroot/index.html" -ls *.jpg | sort -k2 -t'_' -r > "$siteroot/photolist.txt" +ls *.jpg | sort -k2 -t'_' -r > "$photolist" while read i; do if [ -f "$i" ]; then @@ -82,26 +83,30 @@ while read i; do noodcount=1 fi fi -done < "$siteroot/photolist.txt" +done < "$photolist" for ((page=1;page<=pageno;page++)); do - echo -n '
') + echo "$htmlpagenumbers" >> "$siteroot/index.$page.html" + sed -i "s%%$htmlpagenumbers%" "$siteroot/index.$page.html" + echo '' >> "$siteroot/index.$page.html" done echo "Searching for deleted images" for i in $siteroot/img/*.jpg; do pic="$(basename $i)" - if ! grep -Fxq "$pic" "$siteroot/photolist.txt"; then + if ! grep -Fxq "$pic" "$photolist"; then rm -v "$siteroot/img/thumbs/$pic" "$siteroot/img/$pic" fi done -rm -v "$siteroot/photolist.txt" +rm -v "$photolist"