IT3110 - System Automation

IT3110 @ utahtech

Week 3 assignment

Description

Begin by joining my github classroom using the following link. You will put your assignment submissions for each week into this repo.

After the repo has been forked to your account, you can then clone it and modify the files within it. You should look at the week1/assignment.sh. This shell script has the following specifications.

The script has the following functions:

You also need a call to the main function. You should call it in this fashion:

   # do not run main when sourcing the script
   #[[ "$0" == "${BASH_SOURCE[0]}" ]] && main "$@" || true
   main

A sample run of the script may be like follows:

    joe@yavin:~/s23/it3110/scripts/bash/week1$ ./a1.sh clarke 2 https://it3110.cs.utahtech.edu/files/have_found.txt
    Column 2 for the machine clarke is:
    b8:ac:6f:ab:91:1d
    joe@yavin:~/s23/it3110/scripts/bash/week1$ ./a1.sh clarke 1 https://it3110.cs.utahtech.edu/files/have_found.txt
    Column 1 for the machine clarke is:
    clarke
    joe@yavin:~/s23/it3110/scripts/bash/week1$ ./a1.sh zinc 2 https://it3110.cs.utahtech.edu/files/have_found.txt
    Column 2 for the machine zinc is:
    c8:2a:14:3f:a8:e0

Changes to make to your script

You need to create a function called make_dhcp. This function will display the appropriate fixed dhcp entry in the following format:

    host bova {
    hardware ethernet c4:2c:03:25:a2:22; 
    fixed-address 144.38.195.230;
    }

Also, create another function called make_dns. This function will display the appropriate DNS entry for this machine in the following format:

    bova  IN  A 144.38.195.230

Note: there are tabs between each field in the above. There is also a newline at the end.

Make sure that your main function is ONLY calling get_file and get_column.

Pass off

You should upload your script to the week3/assignment.sh directory in github.