[Fai-commit] r3507 - in trunk: debian lib

fai-commit at lists.alioth.debian.org fai-commit at lists.alioth.debian.org
Mon Jun 12 12:30:38 UTC 2006


Author: lange
Date: 2006-06-12 12:30:37 +0000 (Mon, 12 Jun 2006)
New Revision: 3507

Modified:
   trunk/debian/changelog
   trunk/lib/subroutines-linux
Log:
check $IPADDR before appending to etc/hosts (closes: #331258)


Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	2006-06-12 12:17:12 UTC (rev 3506)
+++ trunk/debian/changelog	2006-06-12 12:30:37 UTC (rev 3507)
@@ -7,6 +7,8 @@
   * do not call mkrwsize if directory doe not exist (closes: 365037)
   * lib/mkrw: add option -n
   * make-fai-nfsroot: grep before appending to file (closes: 364748)
+  * lib/subroutines-linux: task_prepareapt(): check $IPADDR before
+    appending to file (closes: #331258)
   
  -- Thomas Lange <lange at debian.org>  Mon, 12 Jun 2006 14:12:34 +0200
 

Modified: trunk/lib/subroutines-linux
===================================================================
--- trunk/lib/subroutines-linux	2006-06-12 12:17:12 UTC (rev 3506)
+++ trunk/lib/subroutines-linux	2006-06-12 12:30:37 UTC (rev 3507)
@@ -128,8 +128,10 @@
     [ -f /etc/hosts ] && cp /etc/hosts $FAI_ROOT/etc
     # set hostname in $FAI_ROOT
     if [ -f /var/run/fai//FAI_INSTALLATION_IN_PROGRESS ]; then
-      echo -e "$IPADDR\t$HOSTNAME.$DOMAIN $HOSTNAME" >>$FAI_ROOT/etc/hosts
       echo $HOSTNAME >$FAI_ROOT/etc/hostname
+      if [ -n "$IPADDR" ]; then
+	  grep -q  $IPADDR $FAI_ROOT/etc/hosts 2>/dev/null || echo -e "$IPADDR\t$HOSTNAME.$DOMAIN $HOSTNAME" >>$FAI_ROOT/etc/hosts
+      fi
     fi
     [ -d /etc/apt ] && cp -r /etc/apt/* $FAI_ROOT/etc/apt/
 }




More information about the Fai-commit mailing list