I suggest that you will need to write a binary program that checks the license in some way, and which perhaps returns a zero or non-zero return code that tells an outer level script what to do. Presumably, this program would invoke the same API (e.g. a library) that the license-controlled applications would also use.
This arrangement ensures that the script verifies the license information in the same way that the applications do, using the same underlying code (and without revealing it). The script then goes on to do what it alone should do, namely, send an e-mail somewhere.
(Incidentally, don't presume that you must use "bash scripting" to do this sort of thing. In Unix/Linux, you can use any one of half-a-dozen scripting tools which are truly built to be such tools. All of them work equally well as "shell scripts," thanks to the clever voodoo magic of #!shebang.
It also strikes me that this ought to be a very-common requirement such that you can purchase (or find open-source) a suitable program with which to do it. I've seen several applications which simply used a public-key encrypted file containing license information: the library contained the public key, used to decrypt the license-file and to in so doing verify its authenticity. But, you shouldn't have to write such a thing from scratch.
(Also: my comment about license techniques is that of a friend who kept an expensive guitar in a cardboard case with a tiny lock on it ... "to keep the honest people out." And it works, even if a slightly-determined hacker "could" defeat it; even if he could defeat it comparatively easily. The most-important consideration for your scheme literally is that it is there, and that it does not get in the way of day-to-day honest usefulness.)
Last edited by sundialsvcs; 10-29-2012 at 05:07 PM.
|