Firmware: A-410 [01 Apr. 2014] | A-400 [12 Mar. 2014] | C-300 [13 Feb. 2014] | A-300 [24 Feb. 2014] | C-200 [11 July 2013] | A-200/A-210 [11 July 2013] | Popbox V8 [3 Dec 2013]

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)
Post Reply 
unpak.sh does not seem to work - rar files are not unpacked
02-03-2012, 07:54 AM (This post was last modified: 02-03-2012 08:50 AM by pieter532.)
Post: #1
unpak.sh does not seem to work - rar files are not unpacked
I tried to solve a problem (see thread). This thread in short ... remove rar files after processing them. Where I removed hash (#) symbols in the "unpak.sh" script. My NZBGet Web Interface (version 1.3 with NZBget 0.6.0) gives the following error.
Problem: Rar files are not unpacked after downloading.

-----
INFO Fri, 03 Feb 2012 06:24:47 +0100 Verifying file <movie>
INFO Fri, 03 Feb 2012 06:24:49 +0100 Repair not needed for <movie>
INFO Fri, 03 Feb 2012 06:24:49 +0100 Executing post-process-script for <movie>
ERROR Fri, 03 Feb 2012 06:24:49 +0100 Could not start script: No such file or directory
INFO Fri, 03 Feb 2012 06:24:49 +0100 Completed post-process-script <movie>
-----
The unpak.sh script has rwx attributes (for U,G and World).
The unpak.sh is in the correct directory.
I changed the unpak.sh script with notepad++ and did a binary up/download.
Executing this script (without parameter) from the command line gave a "bad descriptor" error message.

Is there somebody who can help me?

Pieter

-- start of [/php]the unpak.sh script --
#!/bin/sh
DownloadDir="$1"
NzbFile="$2"
ParCheck=$4
NzbState=$5
ParFail=$6

# Make a logfile
log="$DownloadDir"/unrar.log
export PATH=$PATH:/share/Download

# Check if all is downloaded and repaired
if [ "$NzbState" -eq 1 -a "$ParCheck" -eq 2 -a "$ParFail" -eq 0 ]
then
cd "$DownloadDir"

# Make a temporary directory to store the unrarred files
mkdir extracted

# Remove the Par files
rm *.[pP][aA][rR]2

# Pause NZBGet download until script finishes
/nmt/apps/bin/nzbget -P -c /share/.nzbget/nzbget.conf

# Unrar the files (if any) to the temporary directory, if there are no rar files this will do nothing
if (ls *.rar >/dev/null)
then
/nmt/apps/bin/unrar x -y -p- -o+ "*.rar" ./extracted/
fi

# Remove the rar files (Temporaly disabled just remove # to activate it)
# rm *.r[0-9][0-9]
# rm *.rar
# rm *.s[0-9][0-9]

# Go to the temp directory and try to unrar again.
# If there are any rars inside the extracted rars then these will no also be unrarred
cd extracted
if (ls *.rar >/dev/null)
then
/nmt/apps/bin/unrar x -y -p- -o+ "*.rar"
fi

# Delete the Rar files (Temporaly disabled just remove # to activate it)
rm *.r[0-9][0-9]
rm *.rar
rm *.s[0-9][0-9]

# Move everything back to the Download folder
mv * ..
cd ..

# Clean up the temp folder
rmdir extracted
chmod -R a+rw .
rm *.nzb
rm *.1

# Rename img file to iso so the NMT can read it
# It will be renamed to .img.iso so you can see that it has been renamed
if (ls *.img >/dev/null)
then
imgname=`find . -name "*.img" |awk -F/ '{print $NF}'`
mv $imgname $imgname.iso
fi


# Unpause NZBGet
/nmt/apps/bin/nzbget -U -c /share/.nzbget/nzbget.conf

fi
#################

-- end of the unpak.sh script --
Find all posts by this user
Add Thank You Quote this message in a reply
02-03-2012, 08:11 AM
Post: #2
RE: unpak.sh does not seem to work - rar files are not unpacked
Hey,

My guess is that either something is wrong with the script or with the argument used to call it (I assume this is the filename).
However, you give us very little to go on.
The link to the thread is not working and the content of the script is not in this post, so all we can do is guess.

Maybe add some details (or if the details are in the other thread, fix the link).

H.
Find all posts by this user
Add Thank You Quote this message in a reply
02-03-2012, 08:52 AM
Post: #3
RE: unpak.sh does not seem to work - rar files are not unpacked
Fixed the link. And added the unpak.sh script (in my first post).
Please specify if you need more details/information.
Find all posts by this user
Add Thank You Quote this message in a reply
02-04-2012, 10:20 AM
Post: #4
RE: unpak.sh does not seem to work - rar files are not unpacked
Hello,

The script itself looks fine.
However, I now thoroughly read the output of running the script (and seeing how you have put it in place), the problem is not with the script, but with the ftp.

ASCII files should be ftp'ed in ASCII not in Binary format.
Unless you create them in UNIX format on your PC.

To fix it either;
Upload the script again, but in ASCII format.
run dos2unix on the script.

Hopefully that fixes it.

H.
Find all posts by this user
Add Thank You Quote this message in a reply
02-08-2012, 08:23 PM (This post was last modified: 02-08-2012 08:42 PM by pieter532.)
Post: #5
RE: unpak.sh does not seem to work - rar files are not unpacked
dos2unix ... i know the command. However on my Popcorn .... can't find dos2unix. Arrgghh I never missed VI so much as now... ;0)
Does anybody know where I can find the dos2unix command on my Popcorn?
Find all posts by this user
Add Thank You Quote this message in a reply
02-08-2012, 10:03 PM
Post: #6
RE: unpak.sh does not seem to work - rar files are not unpacked
Hey,

On my A-300 it is in the PATH.
Full path to the file is
/usr/bin/dos2unix

But again, try uploading it in ASCII mode, that should do the trick as well.

Other ways of converting can be found at this website.

P.S. vi is also present on my A-300 at:
/bin/vi

With kind regards,

H.
Find all posts by this user
Add Thank You Quote this message in a reply
[+] 1 user says Thank You to Hendershot for this post
02-09-2012, 11:11 AM (This post was last modified: 02-09-2012 11:19 AM by pieter532.)
Post: #7
RE: unpak.sh does not seem to work - rar files are not unpacked
I transferred the unpak.sh script (ASCII file) with FTP in binary mode which caused the problem. I did a upload in ASCII mode and unpak.sh scripts did it again.

PROBLEM SOLVED.
Find all posts by this user
Add Thank You Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
Sad NZBget 11 is unable to unpack double Rarred files jeffery.leene 0 1,103 11-11-2013 11:59 PM
Last Post: jeffery.leene
  Cannot delete remaining files in \.nzbget\queue ZenphiR 4 1,214 09-07-2013 01:52 PM
Last Post: ZenphiR
  Anyone know how to Make Torrent work on A400 dfv123 1 1,523 12-24-2012 10:13 PM
Last Post: chris57
  Unable to delete files mvveelen 1 869 12-19-2012 07:55 PM
Last Post: mvveelen
  [NZBGET] Do not post Process certain files Bry 8 1,544 12-16-2012 10:15 PM
Last Post: jhmiller
  C-300 unpack script not extracting .rar files to complete mkv and avi files crackcorn69 7 2,827 05-30-2012 11:55 AM
Last Post: crackcorn69
  Can't delete files downloaded with transmission Firebird! 8 4,087 03-08-2012 04:37 PM
Last Post: chris57
  [HELP] Awaiting additional par-files (0.0%) astronyu 1 1,252 02-20-2012 06:08 PM
Last Post: astronyu
  how to remove .rar files? pieter532 10 4,890 02-09-2012 03:22 PM
Last Post: Pierskw
  Failed to parse .nzb files in DMT ladidadi 0 1,035 02-07-2012 01:47 PM
Last Post: ladidadi

Forum Jump: