X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=scripts%2Flive-bottom%2F06hostname;h=b14703a98c0d138b5f2d433bbbb759018cbcb111;hb=ef95487ad06d43885cf8c22ee34156cddc753bd4;hp=75ea8011c589a88666efbf3277cd03c46c774521;hpb=c00d324467314b6f4d6a1d6cc2d9a6ecfbd308cd;p=live-boot-grml.git diff --git a/scripts/live-bottom/06hostname b/scripts/live-bottom/06hostname index 75ea801..b14703a 100755 --- a/scripts/live-bottom/06hostname +++ b/scripts/live-bottom/06hostname @@ -32,7 +32,7 @@ log_begin_msg "Setting hostname" # live-initramfs script # Change hostname only if it is not set -if [ ! -f /root/etc/hostname ] || grep -q localhost\.localdomain /root/etc/hostname +if [ ! -f /root/etc/hostname ] || grep -qs localhost\.localdomain /root/etc/hostname then echo "${HOSTNAME}" > /root/etc/hostname else @@ -41,7 +41,7 @@ else fi # Create /etc/hosts only if it is not present or empty -if [ ! -f /root/etc/hosts ] || [ "$(/root/usr/bin/stat -c %s root/etc/hosts)" == "0" ] +if [ ! -s /root/etc/hosts ] then cat > /root/etc/hosts << EOF 127.0.0.1 localhost