[Initng-svn] r3796 - initng-ifiles/trunk/initfiles/system

svn at initng.thinktux.net svn at initng.thinktux.net
Thu Apr 13 12:59:17 CEST 2006


Author: trigger
Date: Thu Apr 13 12:59:16 2006
New Revision: 3796

Modified:
   initng-ifiles/trunk/initfiles/system/hostname.ii

Log:
simplify and fix hostname for debian a lot - someone should have a look at the other distros, ref #591

Modified: initng-ifiles/trunk/initfiles/system/hostname.ii
==============================================================================
--- initng-ifiles/trunk/initfiles/system/hostname.ii	(original)
+++ initng-ifiles/trunk/initfiles/system/hostname.ii	Thu Apr 13 12:59:16 2006
@@ -1,5 +1,17 @@
 service system/hostname {
 	need = system/initial;
+#ifd debian
+	[ -f /etc/hostname ] && HOSTNAME="$(cat /etc/hostname)"
+
+	# Keep current name if /etc/hostname is missing.
+	[ -z "$HOSTNAME" ] && HOSTNAME="$(hostname)"
+
+	# And set it to 'localhost' if no setting was found
+	[ -z "$HOSTNAME" ] && HOSTNAME=localhost
+
+	echo "Setting hostname to '$HOSTNAME'"
+	hostname "$HOSTNAME"
+#elsed
 	env HOSTNAME=localhost;
 #ifd fedora
 	env_file = /etc/sysconfig/network;
@@ -39,4 +51,5 @@
 		exec @/bin/hostname@ "${HOSTNAME}"
 #endd
 	};
+#endd
 }


More information about the Initng-svn mailing list