Skip to content

Commit

Permalink
Removed rclone binary from the KoboRoot package since it was too big …
Browse files Browse the repository at this point in the history
…for the OS partition. Instead, updated code to dynamically download the rclone binary to the SD card if it's not present.
  • Loading branch information
marklar423 committed Sep 27, 2023
1 parent 4d6d4d4 commit e567a5a
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ After the installation process:
my_google_drive:foldername
# Dropbox:
my_dropbox:other/folder/name/'folder with spaces'
my_dropbox:other/folder/name
```

rclone supports many, many other remote types. See https://rclone.org/docs/ for the full list.
Expand Down
3 changes: 2 additions & 1 deletion src/usr/local/kobocloud/config_kobo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ SD=/mnt/sd/kobocloud
UserConfig=/mnt/onboard/.add/kobocloud/kobocloudrc
RCloneConfig=/mnt/onboard/.add/kobocloud/rclone.conf
Dt="date +%Y-%m-%d_%H:%M:%S"
RCLONE="$KC_HOME/rclone --no-check-certificate "
RCLONEDIR="/mnt/onboard/.add/kobocloud/bin/"
RCLONE="${RCLONEDIR}/rclone"
PLATFORM=Kobo
28 changes: 20 additions & 8 deletions src/usr/local/kobocloud/get.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,27 +44,39 @@ then
echo "NickelDBus found"
else
echo "NickelDBus not found: installing it!"
$CURL -k -L "https://github.com/shermp/NickelDBus/releases/download/0.2.0/KoboRoot.tgz" | tar xz -C /
wget "https://github.com/shermp/NickelDBus/releases/download/0.2.0/KoboRoot.tgz" -O - | tar xz -C /
fi
if [ -f "${RCLONE}" ]
then
echo "rclone found"
else
echo "rclone not found: installing it!"
mkdir -p "${RCLONEDIR}"
rcloneTemp="${RCLONEDIR}/rclone.tmp.zip"
rm -f "${rcloneTemp}"
wget "https://github.com/rclone/rclone/releases/download/v1.64.0/rclone-v1.64.0-linux-arm-v7.zip" -O "${rcloneTemp}"
unzip -p "${rcloneTemp}" rclone-v1.64.0-linux-arm-v7/rclone > ${RCLONE}
rm -f "${rcloneTemp}"
fi
fi

while read url || [ -n "$url" ]; do
echo "Syncing $url"
if echo "$url" | grep -q '^#'; then
echo "Comment found"
continue
elif echo "$url" | grep -q "^REMOVE_DELETED$"; then
echo "Will delete files no longer present on remote"
else
elif [ -n "$url" ]; then
echo "Getting $url"
command=""
if grep -q "^REMOVE_DELETED$" $UserConfig; then
echo ${RCLONE} sync -v --config ${RCloneConfig} $url "$Lib"
# Remove deleted, do a sync.
${RCLONE} sync -v --config ${RCloneConfig} $url "$Lib"
command="sync"
else
echo ${RCLONE} copy -v --config ${RCloneConfig} $url "$Lib"
# Don't remove deleted, do a copy.
${RCLONE} copy -v --config ${RCloneConfig} $url "$Lib"
command="copy"
fi
echo ${RCLONE} ${command} --no-check-certificate -v --config ${RCloneConfig} \"$url\" \"$Lib\"
${RCLONE} ${command} --no-check-certificate -v --config ${RCloneConfig} "$url" "$Lib"
fi
done < $UserConfig

Expand Down
Binary file removed src/usr/local/kobocloud/rclone
Binary file not shown.

0 comments on commit e567a5a

Please sign in to comment.