jebbench
April 19th, 2009, 05:28 PM
Hi,
I've created a script that accepts a file as it's first argument and simply moves the file to another directory.
What I want to do is set this script as the default program for the nzb file type in Firefox so that whenever I download a nzb it is moved to another directory.
If I right click on a nzb and open it with my script it works fine, but if I try to use the "Open with" option in the Firefox download window nothing happens.
The script is
# Script to move passed file to the Hellanzb queue directory.
#
# Define the queue directory.
d="$HOME/.hellanzb/nzb/daemon.queue"
# Check that a file has been passed.
if [ $# -eq 0 ]
then
echo "Usage: hellqueue /path/to/file"
exit 1
fi
if [ -f $1 ]
then
if mv $1 $d
then
echo "File $1 has been moved to $d"
exit 0
fi
else
echo "$1 does not exist."
exit 1
fi
Thanks for any help.
I've created a script that accepts a file as it's first argument and simply moves the file to another directory.
What I want to do is set this script as the default program for the nzb file type in Firefox so that whenever I download a nzb it is moved to another directory.
If I right click on a nzb and open it with my script it works fine, but if I try to use the "Open with" option in the Firefox download window nothing happens.
The script is
# Script to move passed file to the Hellanzb queue directory.
#
# Define the queue directory.
d="$HOME/.hellanzb/nzb/daemon.queue"
# Check that a file has been passed.
if [ $# -eq 0 ]
then
echo "Usage: hellqueue /path/to/file"
exit 1
fi
if [ -f $1 ]
then
if mv $1 $d
then
echo "File $1 has been moved to $d"
exit 0
fi
else
echo "$1 does not exist."
exit 1
fi
Thanks for any help.