@Gigahawk: This, specifically (as well as a number of KUAL extensions) are basic shell scripts. (The keyword being 'shell', not 'bash', the Kindle bundles a terribly outdated version of busybox ash).
In the case of the RP/CRP, there's also an upstart job in there. Which, funnily enough, includes a shell script part xD.
I honestly don't remember how the original code looked, but it's basically three lines, so...
.