#! /bin/sh
#
#   waitsecure.sh
#

fil="$1"

startsec=`cat $1`

sleep 30
while [ -s $fil ]; do
	cursec=`date '+%s'`
	elapsed=$(( $cursec - $startsec ))
	if [ $elapsed -gt 120 ]; then
		elas=$(( ( $elapsed + 30 ) / 60 ))
		elas="${elas}分"
	else
		elas="${elapsed}秒"
	fi
	text="セキュア消去中です。${elas}経過"
	dialog --title "$title" --infobox "$text" 5 72
	sleep 30
done

exit 0
# EOF