# The dbus machine id should be unique for each client, otherwise problems may
# occur, e.g. if a thin client has the same id as the server, then `sudo gedit`
# on the client session which runs on the server gives "access denied"!
# It also helps if it's constant, so we generate it from the client MAC
# address. That way we don't pollute e.g. ~/.pulse/* with random entries on
# fat clients.

if [ -d /var/lib/dbus ]; then
    echo "$(ip link show $DEVICE | awk '/ether/{print $2}' | tr -d ':')00000000000000000000" > /var/lib/dbus/machine-id
fi
