summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael DeHaan <mdehaan@redhat.com>2008-12-17 11:51:40 -0500
committerMichael DeHaan <mdehaan@redhat.com>2008-12-17 11:51:40 -0500
commitc4fb9e6669f32deed7dd58354973da6d39ab2b78 (patch)
treef5b37d72aad3ddae1f53cd4c60e81772ae39d960
parent1385b288dc41948fb7a28f8dfa8de30b81975b0d (diff)
downloadcobbler-c4fb9e6669f32deed7dd58354973da6d39ab2b78.tar.gz
cobbler-c4fb9e6669f32deed7dd58354973da6d39ab2b78.tar.xz
cobbler-c4fb9e6669f32deed7dd58354973da6d39ab2b78.zip
Don't mess with modprobe.conf when it doesn't exist
-rw-r--r--snippets/post_install_network_config10
1 files changed, 9 insertions, 1 deletions
diff --git a/snippets/post_install_network_config b/snippets/post_install_network_config
index 9e121f1a..e21ce960 100644
--- a/snippets/post_install_network_config
+++ b/snippets/post_install_network_config
@@ -54,7 +54,9 @@
## setup bonding if we have to
#if $numbondingdevs > 0
- echo "options bonding max_bonds=$numbondingdevs" >> /etc/modprobe.conf
+ if [-x "/etc/modprobe.conf"]; then;
+ echo "options bonding max_bonds=$numbondingdevs" >> /etc/modprobe.conf
+ fi
#end if
## =============================================================================
@@ -112,7 +114,9 @@
#if $bonding.lower() == "master"
## Add required entry to modprobe.conf
+ if [-x "/etc/modprobe.conf"]; then
echo "alias $iname bonding" >> /etc/modprobe.conf.cobbler
+ fi
#end if
#if $configbymac and $is_vlan == "false" and $bonding.lower() != "master"
@@ -125,10 +129,12 @@
## Rename this interface in modprobe.conf
## FIXME: if both interfaces startwith eth this is wrong
+ if [-x "/etc/modprobe.conf"]; then;
grep \$IFNAME /etc/modprobe.conf | sed "s/\$IFNAME/$iname/" >> /etc/modprobe.conf.cobbler
grep -v \$IFNAME /etc/modprobe.conf >> /etc/modprobe.conf.new
rm -f /etc/modprobe.conf
mv /etc/modprobe.conf.new /etc/modprobe.conf
+ fi
echo "DEVICE=$iname" > $devfile
echo "HWADDR=$mac" >> $devfile
@@ -299,8 +305,10 @@
rm -f /etc/sysconfig/network-scripts/ifcfg-*
mv /etc/sysconfig/network-scripts/cobbler/* /etc/sysconfig/network-scripts/
rm -r /etc/sysconfig/network-scripts/cobbler
+if [-x "/etc/modprobe.conf"]; then;
cat /etc/modprobe.conf.cobbler >> /etc/modprobe.conf
rm -f /etc/modprobe.conf.cobbler
+fi
#end if