Skip to content

Commit

Permalink
Merge pull request #15 from zerotier/someara/networkctl-reload
Browse files Browse the repository at this point in the history
using networkctl reload when file changes
  • Loading branch information
Erik Hollensbe authored Aug 16, 2021
2 parents 35c9a06 + 38a023f commit af8e889
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mgr.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,10 +240,10 @@ func main() {
}

if (changed || len(found) > 0) && *autoRestartFlag {
fmt.Println("Files changed; restarting systemd-resolved...")
fmt.Println("Files changed; reloading systemd-networkd...")

if err := exec.Command("systemctl", "restart", "systemd-resolved").Run(); err != nil {
errExit(fmt.Errorf("While restarting systemd-resolved: %v", err))
if err := exec.Command("networkctl", "reload").Run(); err != nil {
errExit(fmt.Errorf("While reloading systemd-networkd: %v", err))
}
}
}

0 comments on commit af8e889

Please sign in to comment.