#! /usr/bin/sh
#
#ident	"@(#)delay.sh	1.4	04/12/15 SMI"
#
# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
#
daydelay=0
hourdelay=0
mindelay=0
secdelay=0

if [ $# -eq 2 ]
then
	case $1 in
		"s") secdelay=$2 ;;
		"m") mindelay=$2 ;;
		"h") hourdelay=$2 ;;
		"d") daydelay=$2 ;;
		*) secdelay=$2 ;;
	esac
else
	secdelay=$1
fi

delay=`expr $secdelay + $mindelay \* 60 + $hourdelay \* 3600 + $daydelay \* 86400`

sleep $delay
