gensitemaptxt.rc (489B)
1 #!/bin/rc 2 # DEPRECATED: sitemap.tpl now generates and updates a sitemap.txt when requested, and is also more smart than this simplistic script. 3 4 for(d in sites/*/) { 5 echo $d 6 9 du -a $d | awk '/\.(md|html)$/ { print $2 }; {}' | 9 sed -e 's/\.(md|html)$//' -e 's,/index$,/,' -e 's,^sites/,http://,' > $d/sitemap.txt 7 8 if(! test -f $d/robots.txt) { 9 echo generating missing robots.txt for $d 10 echo $d|sed 's,sites/,Sitemap: http://,; s/$/sitemap.txt/;' > $d/robots.txt 11 cat $d/robots.txt 12 } 13 14 }