2014-08-01 17:15:35 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2014-08-01 17:24:38 +00:00
|
|
|
# KOReader's working directory
|
2014-08-01 17:15:35 +00:00
|
|
|
KOREADER_DIR="/mnt/us/koreader"
|
|
|
|
|
2014-08-01 19:59:13 +00:00
|
|
|
# We do NOT want to sleep during eips calls!
|
|
|
|
export EIPS_NO_SLEEP="true"
|
|
|
|
|
2014-08-01 17:15:35 +00:00
|
|
|
# Load our helper functions...
|
2017-04-11 09:28:01 +00:00
|
|
|
if [ -f "${KOREADER_DIR}/libkohelper.sh" ]; then
|
|
|
|
# shellcheck source=/dev/null
|
|
|
|
. "${KOREADER_DIR}/libkohelper.sh"
|
2014-08-01 17:15:35 +00:00
|
|
|
else
|
2017-04-11 09:28:01 +00:00
|
|
|
echo "Can't source helper functions, aborting!"
|
|
|
|
exit 1
|
2014-08-01 17:15:35 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
## First arg is the chekpoint number, and we get one every 200 checkpoints.
|
|
|
|
CHECKPOINT_NUM="${1}"
|
|
|
|
CHECKPOINT_GRANULARITY="200"
|
|
|
|
|
|
|
|
# Use that to build a poor man's progress bar, with dots.
|
2017-04-11 09:28:01 +00:00
|
|
|
PROGRESS_AMOUNT="$((CHECKPOINT_NUM / CHECKPOINT_GRANULARITY))"
|
2014-08-01 17:15:35 +00:00
|
|
|
PROGRESS_STRING="Updating koreader "
|
2017-04-11 09:28:01 +00:00
|
|
|
for _ in $(seq 1 ${PROGRESS_AMOUNT}); do
|
|
|
|
# Append a dot until we hit the needed amount
|
|
|
|
PROGRESS_STRING="${PROGRESS_STRING}."
|
2014-08-01 17:15:35 +00:00
|
|
|
done
|
|
|
|
|
2014-08-01 17:24:38 +00:00
|
|
|
# Print our progress :)
|
2014-08-01 17:15:35 +00:00
|
|
|
eips_print_bottom_centered "${PROGRESS_STRING}" 1
|