Thanks for the tip.
It was there alright.
It was the
koreader\frontend\device\kobo\device.lua
I wanted to use the KSM shutdown script that I had modified to measure the uptime of the device.
It works like a charm.
I've got to keep the Book cover too (I couldn't do this from KSM)