Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Linux - Kernel This forum is for all discussion relating to the Linux kernel.


  Search this Thread
Old 10-26-2012, 10:13 PM   #1
LQ Newbie
Registered: Oct 2012
Posts: 1

Rep: Reputation: Disabled
Need to write a shell script which checks a licence file

Please suggest me a script which needs to check the expiration date of a license file in some location and an automated email should triggered to the mentioned mail id if the expiration date in the license file is less than or equal to 60 days
Old 10-26-2012, 10:19 PM   #2
LQ Veteran
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 15,719

Rep: Reputation: 2120Reputation: 2120Reputation: 2120Reputation: 2120Reputation: 2120Reputation: 2120Reputation: 2120Reputation: 2120Reputation: 2120Reputation: 2120Reputation: 2120
How about you write the script, and if you have problems maybe we can help then.
Old 10-29-2012, 05:02 PM   #3
LQ Guru
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 8,323
Blog Entries: 4

Rep: Reputation: 2837Reputation: 2837Reputation: 2837Reputation: 2837Reputation: 2837Reputation: 2837Reputation: 2837Reputation: 2837Reputation: 2837Reputation: 2837Reputation: 2837
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.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Please help me write shell script to check the modified date of a file. thinhnguyenduy79 Linux - Newbie 1 06-17-2011 04:14 AM
how to write expdp output in a text file using a shell script suman_dba Linux - Newbie 1 02-08-2011 02:52 PM
How to write a shell script which will check a file name in a dir and copy it siris Programming 3 04-08-2010 07:54 PM
shell script that checks for existence of files Rotwang Linux - General 3 12-02-2005 02:11 PM
How to write a shell script to download a file via FTP? guarriman Linux - General 4 12-21-2004 09:31 AM > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 03:39 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration