Giter Club home page Giter Club logo

set-dyn-ip's People

Contributors

jerith666 avatar

Watchers

 avatar  avatar  avatar

set-dyn-ip's Issues

Before changing the IP address, check whether it already has the desired value

In set-dyn-ip.hs, in the changeIpAddr function, fetch the current IP for host from Route53. If it already has the desired value (externIp), print a message saying so and do nothing else. Otherwise, carry out the IP address change as the code already does.

Checklist
  • set-dyn-ip.hs

• Add a call to listResourceRecordSets before the existing code in the changeIpAddr function. Use this function to fetch the current IP address of the host from Route53.
• After fetching the current IP address, compare it with the desired IP address (externIp). Use the == operator in Haskell for this comparison.
• If the current IP address and the desired IP address are the same, use the putStrLn function to print a message saying "The current IP address already has the desired value." and do nothing else.
• If the current IP address and the desired IP address are not the same, proceed with the existing code to change the IP address. This means you need to wrap the existing code in an else block.

Sweep: Before changing the IP address, check whether it already has the desired value

If it already has the desired value, just print a message saying so and do nothing else. Otherwise, carry out the IP address change as the code already does.

Checklist
  • set-dyn-ip.hs

• Add a new function to fetch the current IP address from Amazon AWS Route53. This function should handle any errors that might occur during the fetch operation.
• Modify the function that changes the IP address to first call the new function to fetch the current IP address. Compare the current IP address with the desired one. If they are the same, print a message saying so and return. Otherwise, proceed with the IP address change operation.
• Handle any errors that might occur when changing the IP address. This could be network errors, API errors, etc.

  • test/set-dyn-ip-test.hs

• Create a new test file to test the new functionality.
• Write tests to ensure that the function to fetch the current IP address works as expected.
• Write tests to ensure that the function to change the IP address behaves correctly when the current IP address is the same as the desired one.
• Write tests to ensure that the function to change the IP address behaves correctly when the current IP address is different from the desired one.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.