PKGBUILDs/aur/sabnzbd/addnzb.sh

14 lines
382 B
Bash
Raw Normal View History

2010-09-14 04:47:33 +00:00
#!/bin/bash
. /etc/conf.d/sabnzbd
# SABnzbd must be able to read the file, so we copy it to a directory where it
# certainly has rights.
2010-12-22 20:36:48 +00:00
nzbname=`basename "$1"`
TEMP_NZB="/var/tmp/$nzbname"
2010-09-14 04:47:33 +00:00
2010-12-22 20:36:48 +00:00
cp "$1" $TEMP_NZB
2010-09-14 04:47:33 +00:00
curl -f "$SABNZBD_PROTOCOL://$SABNZBD_USPW$SABNZBD_IP:$SABNZBD_PORT/sabnzbd/api?mode=addlocalfile&name=$TEMP_NZB&pp=1&priority=-1&apikey=$SABNZBD_KEY"
rm $TEMP_NZB
exit 0