feat: only update hostname if set

This commit is contained in:
2025-05-20 11:21:40 +02:00
parent 664684da55
commit b5b7d08f9f

View File

@@ -12,9 +12,12 @@ import (
func Configure(appConfig *config.Config) error {
log.Print("[INFO] Configure system")
// configure hostname
if appConfig.Hostname != "" {
log.Printf("[INFO] update hostname to %s", appConfig.Hostname)
if err := network.SetHostname(appConfig.Hostname); err != nil {
log.Printf("[ERROR] setting hostname failed: %s", err)
}
}
// configure network connections
for _, connection := range appConfig.Network.Connections {
err := util.WithConnection(func(conn *dbus.Conn) error {