# Get hostname from fw_printenv, or use default if command fails
if hostname=$(fw_printenv -n hostname 2>/dev/null); then
    echo "Hostname found in EEPROM: $hostname"
else
    hostname="web-888"
fi

echo $hostname > /etc/hostname
