From 9522360ae301365b8816f7d0c7cd48a86a488d4e Mon Sep 17 00:00:00 2001 From: Sylvain Pineau Date: Tue, 14 Jul 2020 12:00:27 +0200 Subject: bin:network_predictable_names -> network_predictable_names.sh --- bin/network_predictable_names | 45 ---------------------------------------- bin/network_predictable_names.sh | 45 ++++++++++++++++++++++++++++++++++++++++ units/networking/jobs.pxu | 2 +- 3 files changed, 46 insertions(+), 46 deletions(-) delete mode 100755 bin/network_predictable_names create mode 100755 bin/network_predictable_names.sh diff --git a/bin/network_predictable_names b/bin/network_predictable_names deleted file mode 100755 index 20c52df..0000000 --- a/bin/network_predictable_names +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/sh - -set -e - -# Script to verify that all network interfaces have predictable names -# -# Copyright (c) 2018 Canonical Ltd. -# -# Authors -# dann frazier -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License version 3, -# as published by the Free Software Foundation. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# -# The purpose of this script is to identify any network interfaces -# that do not have a predictable name. See: -# https://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/ -# -# Usage: -# network_predictable_names -# -# Parameters: -# None - -failed=0 - -for iface in /sys/class/net/*; do - iface=${iface##*/} - - if [ "${iface}" != "${iface#eth}" ]; then - echo "** Error: Network interface $iface is not a predictable name" - failed=1 - fi -done - -exit $failed diff --git a/bin/network_predictable_names.sh b/bin/network_predictable_names.sh new file mode 100755 index 0000000..31cf49f --- /dev/null +++ b/bin/network_predictable_names.sh @@ -0,0 +1,45 @@ +#!/bin/sh + +set -e + +# Script to verify that all network interfaces have predictable names +# +# Copyright (c) 2018 Canonical Ltd. +# +# Authors +# dann frazier +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 3, +# as published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +# The purpose of this script is to identify any network interfaces +# that do not have a predictable name. See: +# https://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/ +# +# Usage: +# network_predictable_names.sh +# +# Parameters: +# None + +failed=0 + +for iface in /sys/class/net/*; do + iface=${iface##*/} + + if [ "${iface}" != "${iface#eth}" ]; then + echo "** Error: Network interface $iface is not a predictable name" + failed=1 + fi +done + +exit $failed diff --git a/units/networking/jobs.pxu b/units/networking/jobs.pxu index 7de077f..bf9254f 100644 --- a/units/networking/jobs.pxu +++ b/units/networking/jobs.pxu @@ -82,7 +82,7 @@ plugin: shell category_id: com.canonical.plainbox::networking template-engine: jinja2 id: networking/predictable_names -command: network_predictable_names +command: network_predictable_names.sh _summary: Verify that all network interfaces have predictable names. _description: Verify that all network interfaces have predictable names. requires: -- cgit v1.2.3