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