Update to Hub
All checks were successful
build-binaries / build (.exe, amd64, windows) (push) Successful in 10m46s
build-binaries / release (push) Successful in 15s
build-binaries / publish-agent (push) Successful in 7s

This commit is contained in:
2025-10-26 02:08:30 +01:00
parent 3b2827bf70
commit bf25ef967d
2 changed files with 104 additions and 1 deletions

17
main.go
View File

@@ -33,6 +33,21 @@ var (
reKVIAID = regexp.MustCompile(`^IAID=(\d+)`) // systemd-networkd
)
func getenv(k, d string) string {
if v := os.Getenv(k); v != "" {
return v
}
return d
}
func enabled(k string, def bool) bool {
b, err := strconv.ParseBool(strings.ToLower(os.Getenv(k)))
if err != nil {
return def
}
return b
}
func iaidsLinux() ([]iaidInfo, error) {
candidates := []string{
"/var/lib/NetworkManager",
@@ -292,7 +307,7 @@ func main() {
body, _ := json.Marshal(p)
// --- HTTP senden ---
url := "https://client-ipv6.stadt-hilden.de/register" // <-- ggf. anpassen
url := getenv("DUID_REGISTER_URL", "https://client-ipv6.stadt-hilden.de/register") // <-- ggf. anpassen
req, _ := http.NewRequest(http.MethodPost, url, bytes.NewReader(body))
req.Header.Set("Content-Type", "application/json")