From 4c955a6b6838346bb44af4557891129e2016f9d0 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Sun, 31 Jan 2010 15:41:11 +0100 Subject: [PATCH] scripts/GRMLBASE/38-udev: check for presence of config file. --- etc/grml/fai/config/scripts/GRMLBASE/38-udev | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/etc/grml/fai/config/scripts/GRMLBASE/38-udev b/etc/grml/fai/config/scripts/GRMLBASE/38-udev index 0cad436..a041632 100755 --- a/etc/grml/fai/config/scripts/GRMLBASE/38-udev +++ b/etc/grml/fai/config/scripts/GRMLBASE/38-udev @@ -19,9 +19,13 @@ STRING='This file was automatically generated by the /lib/udev/write_net_rules' # Unknown net device (/devices/virtio-pci/virtio0/net/eth0) (virtio_net) # SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="XX:XX:XX:XX:XX:XX", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0" # so therefore remove such an automatically generated file instead. -if grep -q "$STRING" "$CONFFILE" ; then - echo "Automatically generated /etc/udev/rules.d/70-persistent-net.rules found, removing it." - rm -f "$CONFFILE" +if ! [ -r "$CONFFILE" ] ; then + echo "$CONFFILE does not exist, nothing to do." +else + if grep -q "$STRING" "$CONFFILE" ; then + echo "Automatically generated /etc/udev/rules.d/70-persistent-net.rules found, removing it." + rm -f "$CONFFILE" + fi fi ## END OF FILE ################################################################# -- 2.1.4