I am trying to make motion upload every picture it takes.
I have the following line in my motion.conf
on_picture_save = /root/ftpput.sh %f

and the ftpput.sh script looks like this
#!/bin/sh
ftp -n 123.123.123.123 <<END_SCRIPT
quote USER valvonta
quote PASS valvonta
put $ 1
quit
END_SCRIPT
exit 0


The script works fine if I run it separately but with motion.