2
0
mirror of https://github.com/koreader/koreader synced 2024-10-31 21:20:20 +00:00
koreader/launchpad/kpdf.sh
HW ed0d1c40fe reworked parameter parsing a bit
this still allows to use last viewed document even when
we flag that the framework should be stopped
2012-04-17 00:12:19 +02:00

35 lines
863 B
Bash
Executable File

#!/bin/sh
export LC_ALL="en_US.UTF-8"
echo unlock > /proc/keypad
echo unlock > /proc/fiveway
# we're always starting from our working directory
cd /mnt/us/kindlepdfviewer/
# bind-mount system fonts
if ! grep /mnt/us/kindlepdfviewer/fonts/host /proc/mounts; then
mount -o bind /usr/java/lib/fonts /mnt/us/kindlepdfviewer/fonts/host
fi
# check if we are supposed to shut down the Amazon framework
if test "$1" == "--framework_stop"; then
shift 1
/etc/init.d/framework stop
fi
# finally call reader
./reader.lua "$1" 2> /mnt/us/kindlepdfviewer/crash.log || cat /mnt/us/kindlepdfviewer/crash.log
# unmount system fonts
if grep /mnt/us/kindlepdfviewer/fonts/host /proc/mounts; then
umount /mnt/us/kindlepdfviewer/fonts/host
fi
# always try to continue cvm
killall -cont cvm || /etc/init.d/framework start
# cleanup hanging process
killall lipc-wait-event