# SPDX-License-Identifier: MIT
# SPDX-FileCopyrightText: Copyright 2015-2022 SUSE LLC

# Returns the basename of the target of network.service,
# e.g. "wicked" or "NetworkManager"
current_network_service()
{
	systemctl show -P Id network.service | cut -d. -f1
}

network_service="$(current_network_service)"
if [ -e "/usr/share/jeos-firstboot/modules/network-modules/${network_service}" ]; then
	. "/usr/share/jeos-firstboot/modules/network-modules/${network_service}"
else
	echo "No network configuration module for ${network_service} found" >&2
fi
