Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow executing external command if IP has changed #31

Open
OevreFlataeker opened this issue Jul 24, 2024 · 0 comments
Open

Allow executing external command if IP has changed #31

OevreFlataeker opened this issue Jul 24, 2024 · 0 comments

Comments

@OevreFlataeker
Copy link

OevreFlataeker commented Jul 24, 2024

I would like to document the changes of my external IP and perform some action once then change. Though I could as well write my own "detection script", I'd rather use your tool, because all the detection logic is already there.

I'd fancy an cmdline arg which allows to specify an external command (i.e. another bash script) that will get called once an ip changed:

The relevant code portion (for IPv4) would probably be:

            if ($ipv4change === true) {
                $foundHostsV4[0]['destination'] = $publicIPv4;
                //Update the record
                if (updateDnsRecords($domain, CUSTOMERNR, APIKEY, $apisessionid, $foundHostsV4)) {
                    outputStdout("IPv4 address updated successfully!");
                } else {
                    exit(1);
                }

Ideally the new IP should be given as a cmd line argument to the command.

Thanks for considering

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant