mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
add safemode tool support
https://github.com/pazos/cervantes-safemode ref: https://www.mobileread.com/forums/showpost.php?p=3760905&postcount=2 - kodeps.tar.gz
This commit is contained in:
committed by
Frans de Jonge
parent
6c6bec35ec
commit
b69882fa34
@@ -41,19 +41,34 @@ if [ "$PCB_ID" -eq 68 ] && lsmod | grep -q 8189fs; then
|
||||
modprobe -r 8189fs
|
||||
fi
|
||||
|
||||
# start usbnet using BQ scripts (192.168.4.1/24 w/ hardcoded MAC addr)
|
||||
/usr/bin/usbup.sh
|
||||
/usr/sbin/inetd
|
||||
# use 'safemode' tool whenever possible instead of enabling usbnet unconditionally.
|
||||
if [ -x /usr/bin/safemode ]; then
|
||||
safemode network
|
||||
else
|
||||
# start usbnet using BQ scripts
|
||||
/usr/bin/usbup.sh
|
||||
/usr/sbin/inetd
|
||||
fi
|
||||
|
||||
# check if KOReader script exists.
|
||||
if [ -x /mnt/private/koreader/koreader.sh ]; then
|
||||
# yada! KOReader is installed and ready to run.
|
||||
while true; do
|
||||
/mnt/private/koreader/koreader.sh
|
||||
sleep 1
|
||||
if [ -x /usr/bin/safemode ]; then
|
||||
safemode storage || sleep 1
|
||||
else
|
||||
sleep 1
|
||||
fi
|
||||
done
|
||||
else
|
||||
# nothing to do, leaving rc.local.
|
||||
# KOReader script not found or not executable.
|
||||
# if 'safemode' was found enable usbnet now, since it is currently disabled
|
||||
if [ -x /usr/bin/safemode ]; then
|
||||
/usr/bin/usbup.sh
|
||||
/usr/sbin/inetd
|
||||
fi
|
||||
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user