Timed Lock
----------v0.1a
          by peterson, via mobileread.com
          thanks to the great folks in the Kindle developer corner

Security is not an all-or-nothing situation. But for your Kindle, the only
"physical" security you can add is a user passcode that has to be entered
when you wake your Kindle up from screensaver. The choices are thus no
security, or entering your passcode every single time. The latter can become
annoying very fast, e.g. if you just turned your Kindle off (or closed the
magic cover) a second ago to talk to or interact with some people (think
waiting room, train, plane, etc).

This extension tries to find a middle-ground by allowing you more fine-tuned
control over your Kindle's passcode requirement. It basically supports two
features:

1) Only require passcode when device was off for a certain duration.
2) Disable/enable passcode based on time of day, e.g. no passcode required
   at night when you are home, only during the day when you are out and about.

Security is a tricky situation. Whether you use either of these two features
(or both) and what settings you put in, depends entirely on your specific
situation and your compromises. Think clearly about it and remember that you
use this extension on your own risk.

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!! DANGER !!! DANGER !!! DANGER !!! DANGER !!! DANGER !!! DANGER !!! DANGER !!!
!!!                                                                          !!!
!!! Under no circumstances should you activate this extension if you have no !!!
!!! passcode set. If you disabled the passcode via the Kindle settings, this !!!
!!! extension may not be able to recognize it and when enabling the passcode !!!
!!! there is no way to unlock it via the user interface! This especially     !!!
!!! applies to disabling the passcode while the extension is running. DO NOT !!!
!!! do this!                                                                 !!!
!!!                                                                          !!!
!!! In case you manage to lock yourself out, you can ssh into your Kindle    !!!
!!! (hopefully you set this up before!) and unlock it manually by deleting   !!!
!!! /var/local/system/userpasswdenabled                                      !!!
!!!                                                                          !!!
!!! Also note that rebooting the Kindle while the screensaver is on and the  !!!
!!! locking is off (by schedule or by timeout) will effectively disable the  !!!
!!! password protection. You need to set the passcode again and re-enable    !!!
!!! the extension in that case. So make sure that nobody can reset it during !!!
!!! these times! Reboots while the Kindle is on will keep the passcode       !!!
!!! active.                                                                  !!!
!!!                                                                          !!!
!!! DANGER !!! DANGER !!! DANGER !!! DANGER !!! DANGER !!! DANGER !!! DANGER !!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Disclaimer
----------

As of version 0.1, this extension has only been tested on a Kindle Paperwhite 2.

If you get this extension to run on your device, please provide feedback
at http://www.mobileread.com/forums/showthread.php?t=3228496 where you will
also find the latest version.

Either way, as usual please be advised that you are using this extension on
your own risk. 


Prerequisites
-------------

* KUAL is recommended.


Installation
------------

Unzip the downloaded file into the extensions folder (/mnt/us/extensions
when using SSH, otherwise the extensions folder at root of the Kindle volume
when connected to your PC).


Configuration
-------------

Edit timedlock/bin/config.sh, all available options are described here. Note
that you MUST use an editor that supports Unix line endings. On Windows, use
e.g. the free notepad++ application.


Use
---

Run KUAL and enter the "Timed Lock" section. You will see the following
options:

* "Test auto-control" - This will start the extension in the background, but
  after rebooting it will be disabled again.
* "Kill test auto-control" - This will kill the running auto-control, e.g.
  the one you started via the "Test auto-control" button.
* "Auto-Control - enable" - This will start the extension and enable auto-
  start, i.e. the extension will start every time you reboot your Kindle.

When auto-control is active, the menu items will disappear and be replaced
by "Auto-Control - disable", which will disable the auto-control.

All these functions can be done also on a terminal on your Kindle (e.g. via
ssh). Just go to /mnt/us/extensions/timedlock/bin where you will find
the following scripts:

* checkschedule.sh - checks whether your configured schedule makes sense
* config.sh - your configuration (for you to edit before activating!)
* disable.sh - disable auto-control
* enable.sh - enable auto-control
* test.sh - run the extension (without enabling auto-start)
* timedlock.sh - the auto-control, run manually to test and see
  debug output (depending on your config)
* utils.sh - various utility functions used by timedlock.sh


Uninstalling
------------

It is recommended to disable auto-control via KUAL or the disable.sh script
prior to deleting the folder from the extensions directory.
