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).   HOW TO DO THIS? PLEASE EXPLAIN WITH ANSWER!!

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

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).

 

HOW TO DO THIS? PLEASE EXPLAIN WITH ANSWER!!

SAMPLE OUTPUT (user input shown in bold):
$ . /minor2.sh
Wed Feb 13 01:05:25 CST 2019 ) initial users logged in
> xyz0123 logged in to cse01
> abc0456 logged in to cse01
> def0789 logged in to cse01
> mat0299 logged in to cse01
> mn0012 logged in to cse01
> rst0034 logged in to cse01
> jkl0056 logged in to cse01
> uv0078 logged in to cse01
# of users: 8
Wed Feb 13 01:05:25 CST 2019 )
Wed Feb 13 01:05:35 CST 2019 ) # of users: 8
Wed Feb 13 01:05:45 CST 2019 )
Wed Feb 13 01:05:55 CST 2019 ) # of users: 8
Wed Feb 13 01:06:05 CST 2019 ) # of users:
mat0299 logged in to cse01
Wed Feb 13 01:06:15 CST 2019 ) # of users: 9
Wed Feb 13 01:06:25 CST 2019 ) # of users: 9
> mat0299 logged in to cse01
# of users: 8
8
> mn0012 logged out of cse01
Wed Feb 13 01:06:35 CST 2019 ) # of users:
Wed Feb 13 01:06: 45 CST 2019 ) # of users: 9
^C (SIGINT) ignored. enter ^C 1 more time to terminate program.
Wed Feb 13 01:06:52 CST 2019 ) # of users: 9
9
Transcribed Image Text:SAMPLE OUTPUT (user input shown in bold): $ . /minor2.sh Wed Feb 13 01:05:25 CST 2019 ) initial users logged in > xyz0123 logged in to cse01 > abc0456 logged in to cse01 > def0789 logged in to cse01 > mat0299 logged in to cse01 > mn0012 logged in to cse01 > rst0034 logged in to cse01 > jkl0056 logged in to cse01 > uv0078 logged in to cse01 # of users: 8 Wed Feb 13 01:05:25 CST 2019 ) Wed Feb 13 01:05:35 CST 2019 ) # of users: 8 Wed Feb 13 01:05:45 CST 2019 ) Wed Feb 13 01:05:55 CST 2019 ) # of users: 8 Wed Feb 13 01:06:05 CST 2019 ) # of users: mat0299 logged in to cse01 Wed Feb 13 01:06:15 CST 2019 ) # of users: 9 Wed Feb 13 01:06:25 CST 2019 ) # of users: 9 > mat0299 logged in to cse01 # of users: 8 8 > mn0012 logged out of cse01 Wed Feb 13 01:06:35 CST 2019 ) # of users: Wed Feb 13 01:06: 45 CST 2019 ) # of users: 9 ^C (SIGINT) ignored. enter ^C 1 more time to terminate program. Wed Feb 13 01:06:52 CST 2019 ) # of users: 9 9
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY