2018-04-08 20:39:52 +00:00
|
|
|
#!/bin/sh
|
|
|
|
export LC_ALL="en_US.UTF-8"
|
|
|
|
|
|
|
|
# working directory of koreader
|
|
|
|
KOREADER_DIR="${0%/*}"
|
|
|
|
|
2024-03-15 16:43:00 +00:00
|
|
|
if [ $# -eq 1 ] && [ -e "$(pwd)/${1}" ]; then
|
|
|
|
ARGS="$(pwd)/${1}"
|
|
|
|
else
|
|
|
|
ARGS="${*}"
|
|
|
|
fi
|
|
|
|
|
2018-04-08 20:39:52 +00:00
|
|
|
# we're always starting from our working directory
|
|
|
|
cd "${KOREADER_DIR}" || exit
|
|
|
|
|
|
|
|
RETURN_VALUE=85
|
|
|
|
|
2020-02-02 19:35:21 +00:00
|
|
|
while [ ${RETURN_VALUE} -eq 85 ]; do
|
2024-03-15 16:43:00 +00:00
|
|
|
./reader.lua "${ARGS}"
|
2018-04-08 20:39:52 +00:00
|
|
|
RETURN_VALUE=$?
|
2024-03-15 16:43:00 +00:00
|
|
|
# do not restart with saved arguments
|
|
|
|
ARGS="${HOME}"
|
2018-04-08 20:39:52 +00:00
|
|
|
done
|
|
|
|
|
2020-02-02 19:35:21 +00:00
|
|
|
exit ${RETURN_VALUE}
|