#!/bin/sh

CROND="/etc/cron.d/update-bitkeys"
if [ ! -e $CROND ]; then
    H=$( /usr/bin/perl -e 'srand(); print int(rand(24));' )
    M=$( /usr/bin/perl -e 'srand(); print int(rand(60));' )

    cat >$CROND <<EOT
$M $H * * *    root    (HOME=/root && /usr/bin/bitkeys) >/dev/null 2>&1
EOT
    chown root:root $CROND
    chmod 644 $CROND
fi
