[19. April 2013] A-400 Advanced Network Setup now available | [11 Jan. 2013] Customize your A-400 Home Screen

Firmware: A-400 [13 May 2013] | C-300 [30 Nov. 2012] | A-300 [30 Nov. 2012] | C-200 [21 Jan. 2013] | A-200/A-210 [10 Aug. 2012]

Just got your NMT | WIKI has the answers | Search the forum | Forum Rules/Policy | Firmware & Official NMT News | Popcornhour manuals



User(s) browsing this thread: 1 Guest(s)
Thread Closed 
help with auto unrar script.
05-15-2010, 10:24 AM
Post: #1
help with auto unrar script.
Hi I'm currently using Ciaos script which he posted here

Code:
#!/bin/bash
#

if [ $# = 0 ]; then
  echo "Please state working directory."
  exit 0
fi

find $1 \( ! -regex '.*/\..*' \) -type d | while read d
do
    echo "Currently checking $d ..."
    rarcount=$(find "$d" -maxdepth 1 \( ! -regex '.*/\..*' \) -name '*'.rar | wc -l)
    echo $rarcount files found

    if [ $rarcount -ge 1 ] ; then
        echo "Unpacking rar..."
        unrar x -o- -inul "$d/*.rar" "$d"
        if [ $? = 0 ]; then
            rm -f "$d"/*.rar
        else
            echo "FAILED: ${d}"
        fi
    else
        echo No RAR-files found
    fi
done
#
#

It works just like it should and have saved me tons of work! thanks again Ciao for making this public! Smile

My question though, I have lots of movies which I have unrared in CD1, CD2, SUBS structure.

Can someone perhaps expand upon this script so that if CD1 etc.. exist in the directory that it moves the avi/srt file, it previously extracted one folder up. So all avi and srt files are in the base dir?

Previously:

moviename.nfo
CD1/movie-cd1.avi
CD1/movie-cd1.srt
CD2/movie-cd2.avi
CD2/movie-cd2.srt

if the scirpts notices that there is CD1 after unrared the movie, move said files so it looks like this:

moviename.nfo
movie-cd1.avi
movie-cd1.srt
movie-cd2.avi
movie-cd2.srt

If this is possible I and I think many more would love this!
Find all posts by this user
Thread Closed 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Bierdopje auto-sub for A-110 BeeVee 13 2,831 02-06-2013 09:15 PM
Last Post: Gsxie
Star [Apps] Bierdopje 4 NMT PHP script SilverViper 4 1,338 11-26-2012 04:57 PM
Last Post: Djiest
  UNRAR multi archive SiggiAZE 0 1,482 06-24-2011 02:42 PM
Last Post: SiggiAZE
  Unrar multiple files? siul85 13 6,359 06-24-2011 02:01 PM
Last Post: SiggiAZE
  Need help debugging a simple script to enable NTFS write on HDD user33 10 3,198 04-05-2011 06:05 PM
Last Post: nuke12
  Help with Server Timeout Error running a script hindibuff 0 1,687 03-29-2011 06:21 AM
Last Post: hindibuff
Bug Executing a script on the server from the NMT? johnk 6 3,220 02-21-2011 10:59 PM
Last Post: johnk
  [AUDIO] lastfm script (bookmarks, auto-login, etc.) mk11 81 35,431 10-09-2010 01:45 AM
Last Post: opfeifer
  [Telnetd] Unrar stops extracting too early bohlendach 8 2,546 05-15-2010 12:10 PM
Last Post: bohlendach
  [A-100] unrar problems marcolivier 0 1,370 05-03-2010 06:39 PM
Last Post: marcolivier

Forum Jump: