I'd like to make a script that I can execute every time I sign on to my linux box that keeps track of the time and allows to me to add a remark to a file. So basically once I log in, I run the script, and it outputs the date and time to a text file (log.txt). But that isn't my problem.
I need to know how to make it so once i've executed the script in a session, it won't allow me to execute it twice until i've run a sign out script. I'd like it to say something along the lines of "Sorry, you are already signed in!" if i've already run the sign in script.
Then, I need to know what to add to the sign OUT script in order to make it go back to normal the normal signed out state.
I don't know if this makes any sense, but any input would be appreciated! I'll be checking the thread to answer any questions as often as possible. Thanks.