added comments explaining functions
Some checks failed
ci/woodpecker/push/build Pipeline failed

This commit is contained in:
Leopold 2025-04-25 01:00:57 +02:00 committed by Ingwerpold
parent 7761fa4b0c
commit 8285d49a3d

View file

@ -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