Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- USERNAME="mirror"
- PASSWORD="zhegermans"
- IPADRES="127.0.0.1"
- PORT="21"
- SECTIONS="
- /incoming/xvid
- /incoming/tvx264
- "
- proc_listdirs() {
- if [ -n "$1" ]; then
- RELEASES=`lftp -c "open ftp://$USERNAME:$PASSWORD@$IPADRES:$PORT/$1 ; ls -C" | grep -v "_incomplete"`
- fi
- }
- for section in $SECTIONS; do
- proc_listdirs $section
- for rel in $RELEASES; do
- if [[ $rel =~ ^[0-9]{4}$ ]] ; then
- subdir=$rel
- proc_listdirs $section/$subdir
- for rel in $RELEASES; do
- echo $section/$subdir/$rel
- done
- else
- echo $section/$rel
- fi
- done
- done
- exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement