Autor: Alessandro SelliFecha: 2019-03-08 21:56 UTC A: dngAsunto: Re: [DNG] new freedesktop "standard": /etc/machine-id
On 08/03/19 at 18:38, Arnt Karlsen wrote:
>
> ..my /etc/cron.d/machine-id:
> PATH=/bin:/usr/bin:/sbin:/usr/sbin
>
> # ..a new /etc/machine-id every minute... ;o)
> * * * * * root date |md5sum |cut -d" " -f-1 >/etc/machine-id |tee
> >/dev/null 2>&1
What is tee doing there?
It duplicates it's standard input to each of the files it sees as
parameters, and it has none.
Plus, it emits it's standard input to it's standard output, which gets
discarded.
What is the purpose of doing this?
I'd just do this instead:
echo $RANDOM | md5sum | cut -c 1-32 > /etc/machine-id
or maybe:
dd count=1 if=/dev/urandom 2> /dev/null | md5sum | cut -c 1-32 >
/etc/machine-id
--
Alessandro Selli <alessandroselli@???>
VOIP SIP: dhatarattha@???
Chiave firma e cifratura PGP/GPG signing and encoding key:
BA651E4050DDFC31E17384BABCE7BD1A1B0DF2AE