Writes your systems private and public ip addresses

Assignment Help Computer Engineering
Reference no: EM131984987

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

Reference no: EM131984987

Questions Cloud

Why do some people choose linux over windows : Why do some people choose Linux over Windows? Use 2 or 3 sentences to answer this two question, dont copy the answer for web!!!! just input them.
Are such trade publications credible : Are such trade publications credible? Are they scholarly? Would you or would you not cite from them if preparing a professional report or publication
List and describe the six addressing modes of the processor : List and briefly describe the 6 addressing modes of the x86 processor. Description should include how an operand is formed and where it operates on memory.
Are such trade publications credible : Are such trade publications credible? Are they scholarly? Would you or would you not cite from them if preparing a professional
Writes your systems private and public ip addresses : 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.
Write a command that will tell me the unique files : For example, "favicon.ico" is one. Write a command that will tell me the unique files that have been accessed. All of GET, HEAD, and POST count.
Why solid-state drives are preferred over hard drives : Why solid-state drives are preferred over hard drives, particularly in laptop computers. For full credit, you must give sufficient supporting technical detail.
What is the total asset turnover and the capital intensity : Silas 4-Wheeler, Inc., has an ROE of 18.06 percent, equity multiplier of 1.40, and a profit margin of 15.00 percent.
Find all the files and directories in the demo directory : Find all the files and directories in the demo directory that are newer than s1. Send the output of the command to /var/tmp/t1 (dont send it to demo directory).

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd