#!/bin/sh

if [ "$#" = "0" ]; then
	echo "usage: $0 <root@host>" >&2
	exit 1
fi

ssh "$1" 'if ! (/usr/sbin/zdump -v /etc/localtime || /usr/bin/zdump -v /etc/localtime) 2>/dev/null | grep -q "Mar 11.*2007.*gmtoff=-18000"; then
	echo `uname -n` needs DST update, applying...
	mv /etc/localtime /etc/localtime.dstfix.`date +%Y%m%d`
	cat > /etc/localtime
	chmod 644 /etc/localtime
else
	echo `uname -n` knows about the the Energy Policy Act of 2005
fi

date -d "Mar 5 2007 09:00:00 UTC"
date -d "Mar 15 2007 09:00:00 UTC"
' < /usr/share/zoneinfo/America/New_York
