We will conclude this chapter with a pretty cool bash script noweb.sh that makes sure no user is having fun browsing the web on the Firefox browser:
elliot@ubuntu-linux:~$ cat noweb.sh
#!/bin/bash
shutdown_firefox() {
killall firefox 2> /dev/null
}
while [ true ]; do
shutdown_firefox
sleep 10 #wait for 10 seconds
done
Now open Firefox as a background process:
elliot@ubuntu-linux:~$ firefox &
[1] 30436
Finally, make the script executable and run the script in the background:
elliot@ubuntu-linux:~$ chmod a+x noweb.sh
elliot@ubuntu-linux:~$ ./noweb.sh &
[1] 30759
The moment you run your script, Firefox will shut down. Moreover, if you run the script as the root user, none of the system users will be able to enjoy Firefox!