From de16adb62bfc62cdfb2fce185d83bfe157c41803 Mon Sep 17 00:00:00 2001 From: "David Kaspar [Dee'Kej]" Date: Wed, 1 Aug 2018 17:41:08 +0200 Subject: network/ifup/ifdown: deprecation warnings for 'network-scripts' added In case of 'network' service these warnings are displayed only once, to not spam unnecessarily user's journalctl if they have many NICs. --- etc/rc.d/init.d/network | 7 +++++++ network-scripts/ifdown | 6 ++++++ network-scripts/ifup | 6 ++++++ 3 files changed, 19 insertions(+) diff --git a/etc/rc.d/init.d/network b/etc/rc.d/init.d/network index 06723859..36c1a922 100755 --- a/etc/rc.d/init.d/network +++ b/etc/rc.d/init.d/network @@ -49,6 +49,13 @@ interfaces=$(ls ifcfg-* | \ LC_ALL=C sed 's/ //') rc=0 +net_log $"You are using 'network' service provided by 'network-scripts', which are now deprecated." warning network +net_log $"'network-scripts' will be removed from distribution in near future." warning network +net_log $"It is advised to switch to 'NetworkManager' instead for network management." warning network + +# This disables additional warnings during the boot process: +export DEPRECATION_WARNING_ISSUED='true' + # See how we were called. case "$1" in start) diff --git a/network-scripts/ifdown b/network-scripts/ifdown index 18cee69d..5fb6a793 100755 --- a/network-scripts/ifdown +++ b/network-scripts/ifdown @@ -16,6 +16,12 @@ CONFIG=$1 exit 1 } +if ! is_true ${DEPRECATION_WARNING_ISSUED}; then + net_log $"You are using 'ifdown' script provided by 'network-scripts', which are now deprecated." warning ifdown + net_log $"'network-scripts' will be removed from distribution in near future." warning ifdown + net_log $"It is advised to switch to 'NetworkManager' instead - it provides 'ifup/ifdown' scripts as well." warning ifdown +fi + need_config "${CONFIG}" [ -f "$CONFIG" ] || { diff --git a/network-scripts/ifup b/network-scripts/ifup index d25db5af..a90295b7 100755 --- a/network-scripts/ifup +++ b/network-scripts/ifup @@ -31,6 +31,12 @@ CONFIG=${1} exit 1 } +if ! is_true ${DEPRECATION_WARNING_ISSUED}; then + net_log $"You are using 'ifup' script provided by 'network-scripts', which are now deprecated." warning ifup + net_log $"'network-scripts' will be removed from distribution in near future." warning ifup + net_log $"It is advised to switch to 'NetworkManager' instead - it provides 'ifup/ifdown' scripts as well." warning ifup +fi + need_config "${CONFIG}" [ -f "${CONFIG}" ] || { -- cgit v1.2.1