[Debconf-video-commits] r194 - fai-config/scripts/DEBCONF8
holger at alioth.debian.org
holger at alioth.debian.org
Wed Aug 6 18:57:41 UTC 2008
Author: holger
Date: 2008-08-06 18:57:41 +0000 (Wed, 06 Aug 2008)
New Revision: 194
Modified:
fai-config/scripts/DEBCONF8/10-fix-fqdn
Log:
fix mailname and etc/hosts
Modified: fai-config/scripts/DEBCONF8/10-fix-fqdn
===================================================================
--- fai-config/scripts/DEBCONF8/10-fix-fqdn 2008-08-06 16:50:15 UTC (rev 193)
+++ fai-config/scripts/DEBCONF8/10-fix-fqdn 2008-08-06 18:57:41 UTC (rev 194)
@@ -1,18 +1,13 @@
-#! /usr/sbin/cfagent -f
+#!/bin/sh
-control:
- any::
- actionsequence = ( files directories editfiles )
- EditFileSize = ( 30000 )
+# fix /etc/mailname
+echo "$HOSTNAME.dc8.debconf.org" >> /etc/mailname
-files:
- any::
+# fix /etc/hosts
-editfiles:
- any::
- { /etc/hosts
- DeleteLinesStarting '127.0'
- AppendIfNoSuchLine '127.0.0.1 localhost'
- AppendIfNoSuchLine "${IPADDRESS} ${HOSTNAME}.dc8.debconf.org ${HOSTNAME}"
- }
+IPADDRESS=`host $HOSTNAME | awk '{print $4}'|head -1`
+cat /etc/hosts |grep -v "127.0"|grep -v $HOSTNAME > /etc/hosts.tmp
+echo "127.0.0.1 localhost" >> /etc/hosts.tmp
+echo "$IPADDRESS $HOSTNAME.dc8.debconf.org $HOSTNAME" >> /etc/hosts.tmp
+mv /etc/hosts.tmp /etc/hosts
More information about the Debconf-video-commits
mailing list