Skip to content

Allow executing external command if IP has changed #31

@OevreFlataeker

Description

@OevreFlataeker

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions