diff options
-rwxr-xr-x | bin/mp3dir2html | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/bin/mp3dir2html b/bin/mp3dir2html index c22509e..1fee40c 100755 --- a/bin/mp3dir2html +++ b/bin/mp3dir2html @@ -4,14 +4,15 @@ DIRLISTHEAD="/etc/mp3dir2html/head.php" # Regular expression that is to be excluded in the final listing should exist as -# DIRLISTEX='what.*ever|another.*one' in CONFFILE +# DIRLISTEX='what.*ever|another.*one' in CONFFILE. Plus, we need the resulting table's +# id as M3LTABLEID='mp3list' (or whatever else) CONFFILE='/etc/mp3dir2html/mp3dir2html.conf' # CORE SCRIPT FROM HERE. DON'T FIDDLE IF YOU DON'T KNOW WHAT YOU'RE DOING. +M3LTABLEID='mp3list' DIRLISTEX="0x1fedbeef" [ -r "$CONFFILE" ] && . "$CONFFILE" || echo "WARNING: $CONFFILE not readable..." -echo "$DIRLISTEX" function m3l_help { echo "Usage: $(basename $0) [options]";echo @@ -67,6 +68,9 @@ exiftool -ext .mp3 -ext .MP3 -ext .wma -ext .WMA -ext .ogg -ext .OGG -lang en -A m3l_fin_table > content.csv cat "$DIRLISTHEAD" > content.php +echo -n "<div id='m3lmenu'><p>">>content.php +for i in `cat content.csv|awk '{print substr($0,0,1)}'|sort|tr '[:lower:]' '[:upper:]'|uniq`;do echo -n "<a href=\"#_$i\">$i</a>">>content.php;done +echo -e "</p></div>\n<table id='$M3LTABLEID'>">>content.php sed 's/^/<tr><td>/g;s/\t/<\/td><td>/g;s/$/<\/td><\/tr>/g' content.csv >> content.php rm content.csv echo -e '\n\n</table>\n</div>\n</div>\n</body>\n</html>' >> content.php |