Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Assignment: Linux, virtualbox and centOS7

Write a script in BASH that automatically writes your system's private (eth0) and public IP addresses to a file within your home directory called ipaddresses. The automatically generated ipaddresses file should contain the following information:

The date command must be used to provide a timestamp at the top of the file in the following format: Timestamp: (HH:MM) MMDDYYYY.

The next line should contain: ETH0 IP: XXX.XXX.XXX.XXX.

The last line should contain: Public IP: XXX.XXX.XXX.XXX.

The script should overwrite any current entries with the new entries, not append them to the file. Don't forget to change the permissions on the script so that it is executable! Setup a cron job to run the script every 30 mins, you can verify this works by checking the timestamp in the ipaddresses file to see if it is being updated correctly, make sure you let your VM run for a few hours during testing. Be sure to include a copy of your .bashrc file, a copy of your ipaddresses script and output file, and your cron job line in your lab report along with a description of how you set it up and what it means.

I cannot find eth0 when searching for IP, I need to use esp0s8. I tried the following without success, all I get are errors when executed. Any help would be appreciated.

#!/bin/bash

date=$(date +\"%m%d%Y\")

ip=$( ifconfig eth0 | sed -n '2p' | awk '{print $2}' | awk -F : '{print $2}' )

pubip=$(wget -qO- ipinfo.io/ip)

printf $date"\n"$ip"\n"$pubip"\n"i > ~/ip.info ;

#end

Save file in home directory by name "filename.sh" and change permission using following command:

"sudo chmod +x filename.sh"

The edit crontab using command : "crontab -e".

Content of crontab is as follows:

30 * * * * ~/filename.sh

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92822639

Have any Question?


Related Questions in Computer Engineering

You are the senior information security manager for a

You are the senior information security manager for a federal agency. You received a phone call from an employee stating that his laptop was stolen from his workstation. He tells you that the laptop has at least 20 cases ...

Request this to be done in jgrasp1 add a method to the

Request this to be done in JGrasp 1. Add a method to the program that calculates the cube of every number between a lower bound and an upper bound that a user inputs (for instance, lower bound 1 and upper bound 9, for be ...

Question define and briefly discuss the following

Question: Define and briefly discuss the following brainstorming techniques, the delphi technique, brainstorming, or nominal group technique. 1. you are required to write an initial post (300 words). 2. Also discuss adva ...

The project is the process of implementing an information

The project is the process of implementing an information system proposal that provides a specific strategic direction while setting company performance goals and delivering customer value. I need help Identifying 4 diff ...

Once considered pure science fiction artificial

Once considered pure science fiction, artificial intelligence (AI) is being relied on more and more in today's world. Artificial intelligence deals with algorithms based on complex data sets. If you had to tell story rep ...

Rebecca borrows 10000 at 18 compounded annually she pays

Rebecca borrows $10,000 at 18% compounded annually. She pays off the loan over a 5-year period with annual payments, starting at year 1. Each successive payment is $700 greater than the previous payment. (a) How much was ...

Question part 1 analyze the case study titled vodafone a

Question: Part 1: Analyze the case study titled "Vodafone: A Giant Global ERP Implementation" (below) For this assignment, you will need to: 1. analyze and discuss the central issue(s) faced by Vodafone, including the co ...

Question suppose you are now acting as a consultant to an

Question : Suppose you are now acting as a consultant to an organization of your choice that has one or more specific compliance requirements. Considering this scenario, respond to the following: • Describe your selected ...

A club consists of 10 seniors 12 juniors and 15 sophomores

A club consists of 10 seniors, 12 juniors, and 15 sophomores. An organizing committee of size 5 is chosen randomly (with all subsets of size 5 likely). Find the probability that the committee has at least one representat ...

Is it okay too copy a fellow classmate programming code

Is it okay too copy a fellow classmate programming code when you are stuck? Will that break a school honesty policy? Please explain

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As