#!/bin/bash
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo/src/livecd-tools/spind,v 1.5 2005/03/01 18:13:51 wolf31o2 Exp $

CDSIZE=$(($(df -P | grep cdrom | head -n 1 | awk '{print $2}') - 256))
[ -z "${CDSIZE}" ] && echo '>>> Unknown CD size...' && exit 1

echo ">>> CD size: $((${CDSIZE} + 256)) K"
while true
do
	dd if=/dev/cdrom of=/dev/null bs=1K count=1 skip=$((${RANDOM} * ${CDSIZE} / 32768)) 2>/dev/null
	sleep 30
done
