This commit is contained in:
parent
7761fa4b0c
commit
8285d49a3d
1 changed files with 4 additions and 0 deletions
4
main.go
4
main.go
|
|
@ -31,6 +31,8 @@ func main() {
|
|||
}
|
||||
}
|
||||
|
||||
### Checks if the newest IPv6 on the first Interface is not equal to the provided one
|
||||
### Returns the new IPv6 if it changed
|
||||
func checkForNewV6(lastIPv6 string) (string, bool) {
|
||||
interfaces, err := net.Interfaces()
|
||||
if err != nil {
|
||||
|
|
@ -58,6 +60,7 @@ func checkForNewV6(lastIPv6 string) (string, bool) {
|
|||
return lastIPv6, false
|
||||
}
|
||||
|
||||
### Updates the Prefix on the Server
|
||||
func sendNewIP(config conf) error {
|
||||
_, err := http.Get(fmt.Sprintf("https://ipv6.dynv6.com/api/update?ipv6prefix=auto&token=%s&zone=%s", config.token, config.zone))
|
||||
if err != nil {
|
||||
|
|
@ -66,6 +69,7 @@ func sendNewIP(config conf) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
### Reads all ENVIRONMENT variables
|
||||
func readConfigVars() (conf, error) {
|
||||
var zone, token, server string
|
||||
var present bool
|
||||
|
|
|
|||
Loading…
Reference in a new issue