X-Git-Url: http://git.grml.org/?p=grml-autoconfig.git;a=blobdiff_plain;f=etc%2Fgrml%2Fpump-scripts.d%2Fset-hostname;h=f4b46d125fffbec50a5e63d07b522f5d0abb19fa;hp=9c2c51857db070941d6a5e6312c89c3ab9c3b55a;hb=af61464c30dad6bffe1a24d421643c5a26942217;hpb=91d88e67c7e46049809a9b79b6aa7841ecda3c7d 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