Kodi Community Forum

Full Version: lftp on an OSMC or KODI raspberry pi box
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am trying to get an automated lftp script working on my media center, using the script

I am able to create a lftp script successfully on my desktop computer (mac). But I cannot get it to work on the linux in OSMC or KODI. It seems to reject my login credentials and not let me connect to my remote server. I get errors like "mirror: Login failed: Login incorrect." When I try to manually execute an lftp command (not in the script) like ls it attempts to connect to the remote server and then tells me my login is incorrect.
so for example this command works perfectly from Terminal but gives me a "login failed" in OSMC or KODI as soon as I try to execute a command:
lftp -p 22 -u user,password sftp://host.host.com
Can anyone help? the reason I want to do this is that lftp downloads ten times as fast as syncthing or btsync. I have a HD attached directly to my RPi and don't want to mess with streaming or transferring files between computers over my wifi connection.
below is the script I am using (again, works on mac; not on raspberry pi)

[Script beautified by moderator]
cpp:
#!/bin/bash
login=""
pass=""
host=""
remote_dir=''
local_dir=""
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"
/usr/local/bin/lftp -p 22 -u "$login","$pass" sftp://"$host" << EOF set sftp:auto-confirm yes set mirror:use-pget-n 5 mirror -c -P5 "$remote_dir" "$local_dir" quit EOF
rm -f "$lock_file"
trap - SIGINT SIGTERM
exit
fi