OpenELEC Forum
lftp setup for automatic downloads - help - Printable Version

+- OpenELEC Forum (https://forum.openelec.tv)
+-- Forum: Generic Forum (https://forum.openelec.tv/forumdisplay.php?fid=5)
+--- Forum: OPENELEC ADDONS (https://forum.openelec.tv/forumdisplay.php?fid=29)
+---- Forum: unofficial OpenELEC Addons (https://forum.openelec.tv/forumdisplay.php?fid=31)
+---- Thread: lftp setup for automatic downloads - help (/showthread.php?tid=82792)



lftp setup for automatic downloads - help - bjmomo - 10-03-2016

I am trying to configure lftp to automatically download files from a server. I added lftp via the unofficial add ons.

I'm using the following script. It runs fine when I run it from my mac but when I run it from within openelec I get an error message: mirror: Login failed: 530 Login incorrect.

I know that my credentials are right though because I can use them to connect if i do lftp usernam@server and enter my password. can anyone help? thank you.

Code:
#!/bin/bash
login="username"
pass="password"
host="host.iamconneting.to"
remote_dir='~/folder/you/want/to/copy'
local_dir="$HOME/lftp/"

base_name="$(basename "$0")"
lock_file="/tmp/$base_name.lock"
trap "rm -f $lock_file" SIGINT SIGTERM
if [ -e "$lock_file" ]
then
echo "$base_name is running already."
exit
else
touch "$lock_file"
lftp -u $login,$pass $host << EOF
set ftp:ssl-allow no
set mirror:use-pget-n 5
mirror -c -P5 --log="/var/log/$base_name.log" "$remote_dir" "$local_dir"
quit
EOF
rm -f "$lock_file"
trap - SIGINT SIGTERM
exit
fi