From: Michael Prokop Date: Sat, 17 Oct 2009 11:46:35 +0000 (+0200) Subject: pump hostname script: run in live mode only and use grml-hostname; update changelog X-Git-Tag: v0.8.34^0 X-Git-Url: http://git.grml.org/?p=grml-autoconfig.git;a=commitdiff_plain;h=af61464c30dad6bffe1a24d421643c5a26942217;ds=inline pump hostname script: run in live mode only and use grml-hostname; update changelog --- diff --git a/debian/changelog b/debian/changelog index a4a347d..cd348ff 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,24 @@ +grml-autoconfig (0.8.34) unstable; urgency=low + + [ Ulrich Dangel ] + * Integrate patch by Andreas Thienemann (thanks!): + Add a dhcphostname option to grml which will set the hostname of the + booted system according to the dns information. + This Patch implements support for the non-netboot cases by adding + an appropriate script to be called by pump. + + * Reworked and grmlfied patch from Andreas Thienemann: + Introduced etc/grml/pump-scripts.d, added wrapper script + /usr/lib/grml-autoconfig/pump-runparts, modified set-hostname to use + checkbootparam and run it per default (disable via 'nodhcphostname'). + + [ Michael Prokop ] + * Make sure the hostname script is executed only in live mode and + uses grml-hostname for adjusting /etc/hosts as well. + [Closes: issue679] + + -- Michael Prokop Sat, 17 Oct 2009 14:58:28 +0200 + grml-autoconfig (0.8.33) unstable; urgency=low [ Ulrich Dangel ] diff --git a/etc/grml/pump-scripts.d/set-hostname b/etc/grml/pump-scripts.d/set-hostname index 9c2c518..f4b46d1 100755 --- a/etc/grml/pump-scripts.d/set-hostname +++ b/etc/grml/pump-scripts.d/set-hostname @@ -9,16 +9,16 @@ . /etc/grml/autoconfig.functions - # only run if no nodhcphostname parameter is given -if ! checkbootparam 'nodhcphostname' ; then +# and if running in live mode +if ! checkbootparam 'nodhcphostname' && [ -f /etc/grml_cd ] ; then hostname=$(host $3) || exit 1 # dhcphostname is set, get the PTR for the ip hostname=$(echo ${hostname} | awk '{ print substr($5, 0, length($5)-1) }') if [ -n "$hostname" ] ; then - echo $hostname > /etc/hostname + grml-hostname $hostname hostname -F /etc/hostname fi fi