I'm using Ubuntu for my OS and I'm struggling to set my host name and hosts to a mac address automatically any help on this would be great.
NAME=$GATEWAY_MAC| sed s/://g
hostnamectl set-hostname $NAME
sed -i '2d' /etc/hosts
ed /etc/hosts <<-'EOF'
/127.0.0.1/a 127.0.1.1 $NAME
. wq
EOF
cat /etc/hostname cat /etc/hosts
mac
tag is specifically for Apple computers running Ubuntu, not for mac addresses. You can see this in the tag wiki formac
(or if you hover over the tag).