summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Horák <dan@danny.cz>2010-06-28 15:20:05 +0200
committerDan Horák <dan@danny.cz>2010-06-28 15:20:05 +0200
commit5dec421fba9dce1e0d82887efa3ddbd7352aac96 (patch)
tree90412211017114d3aa877c071b4987f8403ba3cc
parent22e174c60c59e3287b69fa9fb3ce26ffb3ea40c6 (diff)
downloadutils-5dec421fba9dce1e0d82887efa3ddbd7352aac96.tar.gz
utils-5dec421fba9dce1e0d82887efa3ddbd7352aac96.tar.xz
utils-5dec421fba9dce1e0d82887efa3ddbd7352aac96.zip
ignore interface config files that match the expression in __sed_discard_ignored_files
device_cio_ignore should match the behaviour of the initscripts network setup functions and ignore the config files that match the expression in __sed_discard_ignored_files
-rw-r--r--device_cio_free12
1 files changed, 11 insertions, 1 deletions
diff --git a/device_cio_free b/device_cio_free
index c0cbb26..9474ba3 100644
--- a/device_cio_free
+++ b/device_cio_free
@@ -282,7 +282,17 @@ if [ $MODE_ZNET ]; then
done < "$ZNETCONFIG"
fi
# process channels from network interface configurations
- for line in $(grep -E -i -h "^[[:space:]]*SUBCHANNELS=['\"]?([0-9]\.[0-9]\.[a-f0-9]+,){1,2}([0-9]\.[0-9]\.[a-f0-9]+)['\"]?([[:space:]]+#|[[:space:]]*$)" /etc/sysconfig/network-scripts/ifcfg-* 2> /dev/null)
+ if [ -z "$__sed_discard_ignored_files" ]; then
+ if [ -f /etc/init.d/functions ]; then
+ . /etc/init.d/functions
+ else
+ # default value copied from initscripts 9.03.10
+ __sed_discard_ignored_files='/\(~\|\.bak\|\.orig\|\.rpmnew\|\.rpmorig\|\.rpmsave\)$/d'
+ fi
+ fi
+ for line in $(grep -E -i -h \
+ "^[[:space:]]*SUBCHANNELS=['\"]?([0-9]\.[0-9]\.[a-f0-9]+,){1,2}([0-9]\.[0-9]\.[a-f0-9]+)['\"]?([[:space:]]+#|[[:space:]]*$)" \
+ $(ls /etc/sysconfig/network-scripts/ifcfg-* | LC_ALL=C sed -e "$__sed_discard_ignored_files") 2> /dev/null)
do
eval "$line"
free_device $SUBCHANNELS