Пример #1
0
static void
init (NMSystemConfigInterface *config)
{
	SCPluginIfcfgPrivate *priv = SC_PLUGIN_IFCFG_GET_PRIVATE (config);

	priv->hostname_monitor = monitor_file_changes (HOSTNAME_FILE, hostname_changed, config);
	priv->dhcp_monitor = monitor_file_changes (CONF_DHCP, hostname_changed, config);

	if (!hostname_is_dynamic ())
		priv->hostname = hostname_read ();
}
static void
setup_monitors (NMIfnetConnection * connection, gpointer user_data)
{
	SCPluginIfnet *self = SC_PLUGIN_IFNET (user_data);
	SCPluginIfnetPrivate *priv = SC_PLUGIN_IFNET_GET_PRIVATE (self);

	priv->hostname_monitor =
	    monitor_file_changes (IFNET_SYSTEM_HOSTNAME_FILE,
				  update_system_hostname, user_data);
	priv->net_monitor =
	    monitor_file_changes (CONF_NET_FILE, reload_connections, user_data);
	priv->wpa_monitor =
	    monitor_file_changes (WPA_SUPPLICANT_CONF, reload_connections,
				  user_data);
}