Advertisement
Guest User

Untitled

a guest
May 1st, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. #!/bin/sh
  2. USERNAME="mirror"
  3. PASSWORD="zhegermans"
  4. IPADRES="127.0.0.1"
  5. PORT="21"
  6.  
  7. SECTIONS="
  8. /incoming/xvid
  9. /incoming/tvx264
  10. "
  11.  
  12. proc_listdirs() {
  13. if [ -n "$1" ]; then
  14. RELEASES=`lftp -c "open ftp://$USERNAME:$PASSWORD@$IPADRES:$PORT/$1 ; ls -C" | grep -v "_incomplete"`
  15. fi
  16. }
  17.  
  18. for section in $SECTIONS; do
  19. proc_listdirs $section
  20. for rel in $RELEASES; do
  21. if [[ $rel =~ ^[0-9]{4}$ ]] ; then
  22. subdir=$rel
  23. proc_listdirs $section/$subdir
  24. for rel in $RELEASES; do
  25. echo $section/$subdir/$rel
  26. done
  27. else
  28. echo $section/$rel
  29. fi
  30. done
  31. done
  32.  
  33. exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement