|
Harald Hoyer |
ee76a0 |
From d37ad6aea04932196df06139b27d3869385617f9 Mon Sep 17 00:00:00 2001
|
|
Harald Hoyer |
ee76a0 |
From: Will Woods <wwoods@redhat.com>
|
|
Harald Hoyer |
ee76a0 |
Date: Wed, 7 Mar 2012 17:21:53 -0500
|
|
Harald Hoyer |
ee76a0 |
Subject: [PATCH] write-ifcfg.sh: cleanups
|
|
Harald Hoyer |
ee76a0 |
|
|
Harald Hoyer |
ee76a0 |
mkdir -p creates intermediate directories and never returns an error, so
|
|
Harald Hoyer |
ee76a0 |
we don't need to create the intermediate directories ourself.
|
|
Harald Hoyer |
ee76a0 |
---
|
|
Harald Hoyer |
ee76a0 |
modules.d/45ifcfg/write-ifcfg.sh | 15 +++++++--------
|
|
Harald Hoyer |
9e9f8f |
1 file changed, 7 insertions(+), 8 deletions(-)
|
|
Harald Hoyer |
ee76a0 |
|
|
Harald Hoyer |
ee76a0 |
diff --git a/modules.d/45ifcfg/write-ifcfg.sh b/modules.d/45ifcfg/write-ifcfg.sh
|
|
Harald Hoyer |
ee76a0 |
index d633a96..0f431e3 100755
|
|
Harald Hoyer |
ee76a0 |
--- a/modules.d/45ifcfg/write-ifcfg.sh
|
|
Harald Hoyer |
ee76a0 |
+++ b/modules.d/45ifcfg/write-ifcfg.sh
|
|
Harald Hoyer |
ee76a0 |
@@ -134,11 +134,10 @@ for netif in $IFACES ; do
|
|
Harald Hoyer |
ee76a0 |
done
|
|
Harald Hoyer |
ee76a0 |
|
|
Harald Hoyer |
ee76a0 |
# Pass network opts
|
|
Harald Hoyer |
ee76a0 |
-[ -d /run/initramfs ] || mkdir -m 0755 -p /run/initramfs
|
|
Harald Hoyer |
ee76a0 |
-cp /tmp/net.* /run/initramfs/ >/dev/null 2>&1
|
|
Harald Hoyer |
ee76a0 |
-for i in /run/initramfs/state /run/initramfs/state/etc/ /run/initramfs/state/etc/sysconfig /run/initramfs/state/etc/sysconfig/network-scripts; do
|
|
Harald Hoyer |
ee76a0 |
- [ -d $i ] || mkdir -m 0755 -p $i
|
|
Harald Hoyer |
ee76a0 |
-done
|
|
Harald Hoyer |
ee76a0 |
-cp /tmp/net.$netif.resolv.conf /run/initramfs/state/etc/ >/dev/null 2>&1
|
|
Harald Hoyer |
ee76a0 |
-echo "files /etc/sysconfig/network-scripts" > /run/initramfs/rwtab
|
|
Harald Hoyer |
ee76a0 |
-cp -a -t /run/initramfs/state/etc/sysconfig/network-scripts/ /tmp/ifcfg/* >/dev/null 2>&1
|
|
Harald Hoyer |
ee76a0 |
+mkdir -m 0755 -p /run/initramfs/state/etc/sysconfig/network-scripts
|
|
Harald Hoyer |
ee76a0 |
+echo "files /etc/sysconfig/network-scripts" >> /run/initramfs/rwtab
|
|
Harald Hoyer |
ee76a0 |
+{
|
|
Harald Hoyer |
ee76a0 |
+ cp /tmp/net.* /run/initramfs/
|
|
Harald Hoyer |
ee76a0 |
+ cp /tmp/net.$netif.resolv.conf /run/initramfs/state/etc/
|
|
Harald Hoyer |
ee76a0 |
+ cp -a -t /run/initramfs/state/etc/sysconfig/network-scripts/ /tmp/ifcfg/*
|
|
Harald Hoyer |
ee76a0 |
+} > /dev/null 2>&1
|