[ ifup = "$ACTION" -a lan = "$INTERFACE" ] && {
	config_load network
	hostname=$(uname -n)
        config_get 'ipaddr' 'lan' 'ipaddr'
        lock /var/lock/hosts
	grep -v __lan__ /etc/hosts > /tmp/hosts
	echo "${ipaddr} $hostname __lan__" >> /tmp/hosts
	diff -q /etc/hosts /tmp/hosts || {
		mv /tmp/hosts /etc/hosts
		logger "Updated /etc/hosts with $ipaddr $hostname"
	}
        lock -u /var/lock/hosts
}
