Skip to content

Instantly share code, notes, and snippets.

@voxxit
Last active August 29, 2015 14:15
Show Gist options
  • Select an option

  • Save voxxit/bf32bf6b7dff209495b3 to your computer and use it in GitHub Desktop.

Select an option

Save voxxit/bf32bf6b7dff209495b3 to your computer and use it in GitHub Desktop.
[Unit]
Description=Set system hostname to Ethernet MAC address
[Service]
Type=oneshot
ExecStart=/bin/bash -c "hostnamectl set-hostname $(cat /sys/class/net/eth0/address | tr -d ':')"
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment