Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #set -x
- P="/root/.newrls"
- mkdir -p "$P"
- #do movies:
- ls -1 /data/Filme/ > "$P"/filme.new
- echo > "$P"/run
- cat "$P"/filme.new | while read line; do
- month="$(echo $line | sed -e 's/\ //g' | tr A-Z a-z)"
- touch "$P"/filme."$month".new
- touch "$P"/filme."$month"
- ls -1 -- /data/Filme/"$line"/ > "$P"/filme."$month".new
- NEWSTUFF="$(diff "$P"/filme.$month $P/filme.$month.new | grep \> | cut -d \> -f 2)"
- if [ "$NEWSTUFF" ]; then
- echo "New for $line: " >> "$P"/run
- echo -e "\n" >> "$P"/run
- echo "$NEWSTUFF" | while read line2; do
- echo "$line2" >> "$P"/run
- done
- echo -e "\n" >> "$P"/run
- fi
- mv -- "$P"/filme."$month".new "$P"/filme."$month"
- done
- #do series...?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement