#!/bin/sh #This script was made by Dean Mitchell (mitch7@shasta.com) #It is free for all non-commercial use and comes with no copyright but #if you use it, PLEASE give me credit. I worked a long, long time #to develop it. #All the sounds for it are at: # sunsite.unc.edu/pub/multimedia/sun-sounds/computer/saytime/ #Thank Sunsite for those. --Dean #System time varibles (only the hour and minute). HTIME=$(date '+%I') MTIME=$(date '+%M') #Directory in which the time sounds are stored SNDDIR="/root/sounds" #Your audio device ADEV="/dev/audio" #Kinda self explanitory TIMEIS="time_is.au" #All the varibles count=0 svar=0 inc=0 fvar=20 coun=20 #Evalute what hour it is while [ $inc -lt $HTIME ] do inc=$(expr $inc + 1) done inc="$inc.au" #Now find the minutes if [ $MTIME -lt 20 ] then while [ $count -lt $MTIME ] do count=$(expr $count + 1) done fvar="oh.au" svar="$count.au" else while [ $coun -lt $MTIME ] do coun=$(expr $coun + 1) svar=$(expr $svar + 1) if [ $svar -eq 10 ] then fvar=$(expr $fvar + 10) svar=0 fi done fvar="$fvar.au" svarl="$svar.au" fi #Start sending the audio files to the audio device cat "$SNDDIR/$TIMEIS" > $ADEV cat "$inc" > $ADEV #This little if statement makes sure that it doesn't say an 'oh before the #minutes if they are past ten. if [ $svar -lt 10 ] then cat "$fvar" > $ADEV fi cat "$svarl" > $ADEV