# 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
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