Don't expect to have these script work out of the box for you! Make sure you have the script made executable. with chmod +x myscript.sh. A read that some people had to make the script "chmod 777 myscript.sh" to get it to work. To use the move script make sure you have write permissions with your sabnzbd+ user in the xbmc library folder. I hope these can help someone!
Send notification to XBMC when download is complete.
Code: Select all
#! /bin/bash
finaldir=$1
oriname=$2
cleanname=$3
status=$7
case $status in
0 )
status="OK";;
1 )
status="Failed Veri" ;;
2 )
status="Failed unpack";;
3 )
status="FverAndFunpack";;
esac
subject="$status : $cleanname"
message="In:$oriname"
wget -q --delete-after "http://XBMC:@192.168.1.251:8080/xbmcCmds/xbmcHttp?command=ExecBuiltIn(Notification($subject,$message,18000))" > /dev/null 2>&1
#for testing purposes
#echo "$1 : $3 : $4 : $5 : $6 : $7" >> ~/.sabnzbd/scripts/scripts.log
Code: Select all
#!/bin/bash
#Sabnzbd variabled assigned to my own variables
finaldir=$1
oriname=$2
cleanname=$3
status=$7
#This is the path where you wan't to move your movie to
myLibraryDir="/home/pietje/path/to/your/xbmc/movies/"
#This part copy's the directory in the nzb dir, to your own movies (library) folder
numberdirs=`find "$finaldir" -maxdepth 1 -type d | wc -l`
if [[ $numberdirs -eq 2 ]]; then
pathinnzb=`ls -d "$finaldir"*/`
mv "$pathinnzb" "$myLibraryDir$cleanname"
echo -e "\nmoved $pathinnzb to: movies\n $myLibraryDir$cleanname" >> ~/.sabnzbd/logs/sabnzbd.log
else
if [ $numberdirs -gt 2 ]; then
echo "Found more then 1 folder in $finaldir!" >> ~/.sabnzbd/logs/sabnzbd.log
fi
if [ $numberdirs -lt 2 ]; then
echo "Did not found any dirs in $finaldir!" >> ~/.sabnzbd/logs/sabnzbd.log
fi
fi
Code: Select all
#!/bin/bash
ipxbmc1="192.168.1.253"
portxbmc="8080"
user="XBMC"
pass=""
wget -q --delete-after "http://$user:$pass@$ipxbmc1:$portxbmc/xbmcCmds/xbmcHttp?command=ExecBuiltIn¶meter=XBMC.updatelibrary(video)" > /dev/null 2>&1
I've called the last script on line 17 in the previous script when the movie could be moved. Just before the else statement. You can ofcourse also put the script in a function and call that.