Giter VIP home page Giter VIP logo

cloudflare-public-dynamic-ip-update's Introduction

Hyecheol (Jerry) Jang

πŸ‘‹ Greetings, Thanks for visiting my GitHub Profile.

Hits Gmail Badge Linkedin Badge

trophy Top Langs Hyecheol's github stats

πŸ”­ I’m currently working on/at ...

  • Social Service Agent @ Repulic of Korea Army
  • On-going Projects
    • Make BSS Great Again (BSS Alumni Website)

🌱 I’m currently learning ...

  • Typescript, C#, PHP
  • Laravel, Blazor, React

πŸ“« How to reach me: ...

Some Facts about Me

🏫 Education

  • University of Wisconsin - Madison (Jul. 2018 - Aug. 2020, (Estimated) Sep. 2022 - May. 2024)
    • B.Sc Computer Science and Statistics, Cert. Entrepreneurship
  • Busan Science High School (Mar. 2015 - Feb. 2017)

⚽ Activities

  • Technical Lead, uniQon (Apr. 2020 - Oct. 2020)
  • Chief Technology Officer, Korean-American Scientists and Engineers Association - Wisconsin Chapter (Jan. 2019 - Aug. 2020)
  • Judge/Staff, 19th International Robot Olympiad (Jul. - Aug, 2017)

πŸ† Awards / Certificates

  • Silver Medal, 18th International Robot Olympiad (Dec. 2016)
  • 4th Place Award, 62th National Science Contest, Earth Science Field (μ „κ΅­κ³Όν•™μ „λžŒνšŒ) (Oct. 2016)
  • 2nd Place Award, 11th Busan Future Scientist Award (λΆ€μ‚°λ―Έλž˜κ³Όν•™μžμƒ) (Dec. 2015)

πŸ”­ Previous Projects

cloudflare-public-dynamic-ip-update's People

Contributors

hyecheol123 avatar rp70 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

cloudflare-public-dynamic-ip-update's Issues

[BUG] The script works perfectly for subdomains but does not work for main domains.

Hi,

Thanks a lot for this beautiful script.
I am using Centos8 server on a Google instance.
jq --version: jq-1.5
I also tried jq-1.6: Same result

I triple-checked my cloudfare_config and all seems fine.
I am using the correct zone ID as well.

The script works perfectly for subdomains but does not work for main domains.

For main domain I am getting the following error:

jq: error (at :1): boolean (true) and boolean (false) cannot be added
record IP needs to be updated for mysite.commysite.commysite.commysite.commysite.com
Fail to update record IP of mysite.commysite.commysite.commysite.commysite.com\nPlease Check result!!
record IP needs to be updated for
Fail to update record IP of \nPlease Check result!!
record IP needs to be updated for
Fail to update record IP of \nPlease Check result!!
record IP needs to be updated for
Fail to update record IP of \nPlease Check result!!
record IP needs to be updated for
Fail to update record IP of \nPlease Check result!!

Am I doing something wrong?
Thanks a lot

[BUG] API Token

Describe the bug
Having issues using bash script with jq. It grabs the IP address properly. API token is tested and working properly.

To Reproduce
Steps to reproduce the behavior:

  1. Installed jq by doing apt install jq
  2. Edit configuration file
  3. Made bash script executable & ran it

Desktop (please complete the following information):

  • OS: Ubuntu 20.04 LXC VPS

Additional context

Dev:~/pkgs/Cloudflare-Public-Dynamic-IP-Update$ ./cloudflare_dynamic_ip_update.bash

current public IP address is HIDDENIP#
jq: error (at <stdin>:1): Cannot iterate over null (null)
jq: error (at <stdin>:1): Cannot iterate over null (null)
jq: error (at <stdin>:1): Cannot iterate over null (null)
jq: error (at <stdin>:1): Cannot iterate over null (null)
jq: error (at <stdin>:1): Cannot iterate over null (null)

[FEATURE] Better Error Messages

Right now, the code is not well organized and it is hard to debug.
To improve readability of code and help finding the errors, The codes need to contains more descriptive and useful error message.

[TEST] Rasberry Pi OS Lite (arm32)

OS Name and Version

Raspberry Pi OS Lite (arm32)

Release date: May 7th 2021
Kernel version: 5.10
$ uname -srm
Linux 5.10.52-v7+ armv7l
$ cat /etc/os-release 
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian

Test Result

1. Current IP is same as record's IP, must see the proper message indicating the identity

Yes. It shows my cloudflare domain and my current public IP address. Clouflare already has the right IP address.

# IP Address and Domain redacted
$ bash ./Cloudflare-Public-Dynamic-IP-Update/cloudflare_dynamic_ip_update.bash 
current public IP address is xxx.xxx.xxx.190
sub.domain.tld: no needs to update

2. Current IP is not same as record's IP, record's IP must be updated and see the proper message indicating the record has been updated

Yes. Here's how I did it:

First I changed my WAN IP address.

  1. Check my current IP with curl ip.me
  2. Turn off my internet modem
  3. Log into my DD-WRT router's web interface.
  4. Release my IP address on my WAN.
  5. Spoof my router's MAC address
  6. Turn on the modem
  7. Wait for a new WAN IP address.
  8. Double-check my IP address Changed with curl ip.me
    xxx.xxx.xxx.230

Then I ran the script again.

# IP Address and Domain redacted
$ bash ./Cloudflare-Public-Dynamic-IP-Update/cloudflare_dynamic_ip_update.bash
current public IP address is xxx.xxx.xxx.230
sub.domain.tld: successfully updated to xxx.xxx.xxx.230

3. Has no connection, and see the error message

Yes.

I unplugged my modem and then ran the script.

$ bash ./Cloudflare-Public-Dynamic-IP-Update/cloudflare_dynamic_ip_update.bash
Check your internet connection, or google DNS server maybe interruptted

[TEST]

OS Name and Version
Indicate your OS Version e.g. Raspberry Pi 3 B+ Running Raspbian

Test Result
1. Current IP is same as record's IP, must see the proper message indicating the identity
Your Answer (No) + Some Explanation
2. Current IP is not same as record's IP, record's IP must be updated and see the proper message indicating the record has been updated
Your Answer (No) + Some Explanation
3. Has no connection, and see the error message
Your Answer (No) + Some Explanation

Additional context
Followed your guide, seems fine, changed all that need, but when i ran the script got error
Current Error when Running The Script :
jq: error (at :1): Cannot iterate over null (null)
jq: error (at :1): Cannot iterate over null (null)
jq: error (at :1): Cannot iterate over null (null)
jq: error (at :1): Cannot iterate over null (null)
jq: error (at :1): Cannot iterate over null (null)

[TEST]

OS Name and Version
Raspbian GNU/Linux 10 (buster)

Test Result
1. Current IP is same as record's IP, must see the proper message indicating the identity
Yes
2. Current IP is not same as record's IP, record's IP must be updated and see the proper message indicating the record has been updated
Yes
3. Has no connection, and see the error message
Yes

Additional context
Required package for jq sudo apt install jq
Required package for dig sudo apt install dnsutils

"Quiet" output for cron use

I was going to run this via cron and it's a bit chatty now.

I manually modified to remove the echo's unless there is an update of an IP as if the IP is the same, I wanted it to be 'quiet' so I can run from cron without any output coming out.

If there is an update, I do want output as everything I have in cron emails out if there is output.

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.