I'm trying to write a script which prevents the concerned user from opening programs (mostly internet browsers) from being run during a certain time (like 1000 to 1200 hrs). This is like a productivity suite. I don't have much problems implementing the timing problem or the user problem. My problem lies in the prevention of task execution.
My question is: How do I stop a process before it starts?
Right now, I have an infinite loop implementation with a pseudo-code as :
while(1) killall midori killall firefox sleep(60s) end
But this is taxing on the computer and I don't want to stop a task if it starts, I want to prevent the task from starting in the first place.