Question: Write a complete bash script that monitors who logs in and logs out of the current CSE Linux machine (e.g., ce1101, cell 02 , etc.)

 Write a complete bash script that monitors who logs in and

Write a complete bash script that monitors who logs in and logs out of the current CSE Linux machine (e.g., ce1101, cell 02 , etc.) where the script is running. In particular, you will check the status of who is logged in every 10 seconds and report each user ID that logs in or logs out during that time frame. Note that there may be more than one user that logs in or out during this interval. You must include the host name when reporting the user ID information. In addition, you will install a custom signal handler to trap the SIGINT (i.e., C ) one time before you are able to terminate the script with the SIGINT. You will also print out the current date and time and report the number of users logged in, even if there are no changes (1.e., no one logged in or out during the interval). Please see the SAMPLE OUTPUT for several examples, including the different scenarios that might occur. REQUIREMENTS: - Your script should be well documented in terms of comments. For example, good comments in general consist of a header (with your name, course section, date, and brief description), comments for each variable, and commented blocks of code. - Your bash script should be named "minor2. sh", without the quotes. Note that this must be done as a bash script, not a C program. 5. / minor 2.sh Wed Feb 13 01:05:25 C3T 2022) initial users logged in > xyz0123 logged in to cello1 >abe0456 logged in to cello > def0789 logged in to cello1 > mat0299 logged in to cello1 > mn0012 logged in to ce1101 > rsto034 logged in to cello1 >jk10056 logged in to cel101 > uv0078 logged in to ce1101 Wed Feb 13 01:05:25 C3T 2022) \#oE users: 8 Wed Feb 13 01:05:35 CST 2022) \# of users: 8 Wed Feb 13 01:05:45 C3T 2022) \# of users: 8 Wed Feb 13 01:05:55 C3T 2022) \# of users: 8 Wed Feb 1301:06:05 C3T 2022) \#oE users: 8> mat0299 logged in to ce1101 Wed Feb 13 01:06:15 c3T 2022) f of users: 9 Wed Feb 1301:06:25 C3T 2022) f of users: 9 > mat0299 logged in to cello1 >mn0012 logged out of cello1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!