Write a complete bash script that monitors who logs in and logs out of the current CSELinux machine (e.g., cse01, cse02, etc.) where the script is running. In particular, youwill check the status of who is logged in every 10 seconds and report each user ID thatlogs in or logs out during that time frame. Note that there may be more than one userthat logs in or out duringthis interval. You must include the host name when reportingthe 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 loggedin,even if there are no changes (i.e.,no one logged in or out during the interval). What should the script.h file have inside it? Please show screenshot of output if possible ,what is the answer?
Write a complete bash script that monitors who logs in and logs out of the current CSELinux machine (e.g., cse01, cse02, etc.) where the script is running. In particular, youwill check the status of who is logged in every 10 seconds and report each user ID thatlogs in or logs out during that time frame. Note that there may be more than one userthat logs in or out duringthis interval. You must include the host name when reportingthe 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 loggedin,even if there are no changes (i.e.,no one logged in or out during the interval).
What should the script.h file have inside it? Please show screenshot of output if possible ,what is the answer?
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 2 images