Skip to content

Instantly share code, notes, and snippets.

@yuan3y
Created October 19, 2014 10:36
Show Gist options
  • Save yuan3y/07262a13a79e451030a4 to your computer and use it in GitHub Desktop.
Save yuan3y/07262a13a79e451030a4 to your computer and use it in GitHub Desktop.
output a html directory to each folder, used for transmission daemon (after finishing downloads)
#!/bin/bash
mybasepath=/down
mybaseurl=http://yuan3y.com/down/
cd "$mybasepath"/
while IFS="" read -r -d $'\000' dir
do
echo "$mybaseurl""$dir" && tree -shC -H "$mybaseurl""$dir" -T "<a href=\"$mybaseurl\">down</a>" -o "$dir"/index.html "$dir"
done < <(find . -type d -print0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment