Question: Please include in the script some comments how the arguments work like the one I attached and encircled. Write a python script called hoster-toaster.py that


 Write a python script called hoster-toaster.py that is used to update a

Please include in the script some comments how the arguments work like the one I attached and encircled.

machine's local hostname resolution file. The details of how it works are

Write a python script called hoster-toaster.py that is used to update a machine's local hostname resolution file. The details of how it works are below: It requires one argument on the command line: the absolute path to a file it will read data from. It will use the information in that file to alter the machine's /etc/hosts file. If it is run with no other options, it will overwrite the contents of /etc/hosts using the new data in the file provided as the argument. If the script is run with the option -r it will update the data currently in /etc/hosts with the information in the provided file. If an ip address in the provided file is not already in /etc/hosts, the entry (and its corresponding hostnames) will be added to /etc/hosts. If an ip address in the provided file is already in /etc/hosts, the entry already in /etc/hosts will be replaced entirely. If it is run with the option -v it will add the data from the provided file to whatever is currently in /etc/hosts. Note: This option can not be used in the same run of the command as -r If an ip address in the provided file is not already in /etc/hosts, the entry (and its corresponding hostnames) will be added to /etc/hosts. If an ip address in the provided file is already in /etc/hosts, the hostnames listed for it in the provided file will be added to the ones already in /etc/hosts.

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 Computer Network Questions!