Automatically restart koreader if it exits or crashes

This commit is contained in:
Cosmin Gorgovan 2016-01-02 23:29:49 +00:00
parent 975109de80
commit ca474d399d
3 changed files with 10 additions and 3 deletions

View File

@ -125,6 +125,14 @@ compile_koreader() {
mkdir opt mkdir opt
cd opt cd opt
tar xf ../../koreader/koreader-kobo-arm-linux-gnueabihf*.targz tar xf ../../koreader/koreader-kobo-arm-linux-gnueabihf*.targz
echo "#!/bin/bash" > koreader/okreader.sh
echo "cd /opt/koreader" >> koreader/okreader.sh
echo "while true; do" >> koreader/okreader.sh
echo " ./luajit ./reader.lua /mnt/onboard" >> koreader/okreader.sh
echo "done" >> koreader/okreader.sh
chmod +x koreader/okreader.sh
cd ../../ cd ../../
dpkg-deb -b koreader-pkg . dpkg-deb -b koreader-pkg .
} }

View File

@ -1,5 +1,5 @@
Package: koreader Package: koreader
Version: 2016.01-1 Version: 2016.01-2
Maintainer: Cosmin Gorgovan <okreader@linux-geek.org> Maintainer: Cosmin Gorgovan <okreader@linux-geek.org>
Architecture: armhf Architecture: armhf
Description: An ebook viewer application. Description: An ebook viewer application.

View File

@ -13,8 +13,7 @@
PATH=/sbin:/usr/sbin:/bin:/usr/bin PATH=/sbin:/usr/sbin:/bin:/usr/bin
do_start () { do_start () {
cd /opt/koreader /opt/koreader/okreader.sh &
./luajit ./reader.lua /mnt/onboard &
} }
case "$1" in case "$1" in