From d8151304689897e376fcbd1a5c28776bd50b9487 Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Mon, 21 May 2018 17:06:09 +0200 Subject: [PATCH] ifcfg-rh: add nm-ifup and nm-ifdown scripts They're intended to be used via update-alternatives(8) as compatibility shims for Red Hat systems without the legacy network control scripts. While they're not strictly parts of the settings plugin, they're best just installed along with it, since they're supposed to be available on systems that use the ifcfg files. --- Makefile.am | 5 +++++ src/settings/plugins/ifcfg-rh/nm-ifdown | 3 +++ src/settings/plugins/ifcfg-rh/nm-ifup | 3 +++ 3 files changed, 11 insertions(+) create mode 100644 src/settings/plugins/ifcfg-rh/nm-ifdown create mode 100644 src/settings/plugins/ifcfg-rh/nm-ifup diff --git a/Makefile.am b/Makefile.am index 79b046280d..f7bc85aeff 100644 --- a/Makefile.am +++ b/Makefile.am @@ -19,6 +19,7 @@ noinst_DATA = sbin_PROGRAMS = bin_PROGRAMS = libexec_PROGRAMS = +dist_libexec_SCRIPTS = lib_LTLIBRARIES = plugin_LTLIBRARIES = core_plugins = @@ -2201,6 +2202,10 @@ src_settings_plugins_ifcfg_rh_tests_test_ifcfg_rh_LDADD = \ $(src_settings_plugins_ifcfg_rh_tests_test_ifcfg_rh_OBJECTS): $(libnm_core_lib_h_pub_mkenums) +dist_libexec_SCRIPTS += \ + src/settings/plugins/ifcfg-rh/nm-ifup \ + src/settings/plugins/ifcfg-rh/nm-ifdown + endif EXTRA_DIST += \ diff --git a/src/settings/plugins/ifcfg-rh/nm-ifdown b/src/settings/plugins/ifcfg-rh/nm-ifdown new file mode 100644 index 0000000000..e7bd73aec3 --- /dev/null +++ b/src/settings/plugins/ifcfg-rh/nm-ifdown @@ -0,0 +1,3 @@ +#!/bin/sh +nmcli connection load "/etc/sysconfig/network-scripts/ifcfg-$1" && +exec nmcli connection down filename "/etc/sysconfig/network-scripts/ifcfg-$1" diff --git a/src/settings/plugins/ifcfg-rh/nm-ifup b/src/settings/plugins/ifcfg-rh/nm-ifup new file mode 100644 index 0000000000..96637a92fb --- /dev/null +++ b/src/settings/plugins/ifcfg-rh/nm-ifup @@ -0,0 +1,3 @@ +#!/bin/sh +nmcli connection load "/etc/sysconfig/network-scripts/ifcfg-$1" && +exec nmcli connection up filename "/etc/sysconfig/network-scripts/ifcfg-$1"