From 085876362ad503d2e8611732bdacdc9e95628d9a Mon Sep 17 00:00:00 2001 From: Stephen Lombard Date: Tue, 23 Feb 2021 20:22:17 -0800 Subject: [PATCH] feat: implement Settings.ReloadConnections --- Settings.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Settings.go b/Settings.go index 4b43370..bb38af5 100644 --- a/Settings.go +++ b/Settings.go @@ -27,6 +27,9 @@ type Settings interface { // ListConnections gets list the saved network connections known to NetworkManager ListConnections() ([]Connection, error) + // ReloadConnections tells NetworkManager to reload all connection files from disk, including noticing any added or deleted connection files. + ReloadConnections() error + // GetConnectionByUUID gets the connection, given that connection's UUID. GetConnectionByUUID(uuid string) (Connection, error) @@ -75,6 +78,12 @@ func (s *settings) ListConnections() ([]Connection, error) { return connections, nil } +// ReloadConnections tells NetworkManager to reload (and apply) configuration files +// from disk taking notice of any added or removed connections. +func (s *settings) ReloadConnections() error { + return s.call(SettingsReloadConnections) +} + // GetConnectionByUUID gets the connection, given that connection's UUID. func (s *settings) GetConnectionByUUID(uuid string) (Connection, error) { var path dbus.ObjectPath