Let me begin by saying that SABnzbd is an incredible piece of software! I'm hoping someday soon to use its RSS capability to ditch cable TV altogether.
At any rate, I am currently trying to write a bash script to upload via FTP completed nzb's to my Popcorn Hour (networked media player, if you don't already know). The script runs without error when an NZB is completed, however on my first test run it tried to upload my entire /usr/bin directory!
Just about everything I know about scripting I have learned in the past couple hours, and I am having trouble pinning down what is going on with the directories here. I am assuming $1 will pass in the path to the completed nzb (ie - /home/brian/downloads/complete/NZB_DIR/). Then I use mput to upload everything in that directory to /Video. Here is what I have so far:
Code: Select all
#!/bin/bash
HOST='192.168.1.188'
USER='ftpuser'
PASSWD='1234'
cd $1
ftp -n -v $HOST << EOT
ascii
user $USER $PASSWD
prompt
cd Video
mput *
bye
bye
EOT