Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > 5183cb97850ab34770e23cc9d644e0d0 > files > 20

watchdog-5.6-2mdv2010.0.i586.rpm

#!/bin/sh

#
# this will unconditionally cause a reboot if the uptime increases 2 days
# some hard disks might need this 
#

#
# get uptime info
#
upt=`cat /proc/uptime | tr -d . | cut -d' ' -f1`

#
# calculated days uptime, note that this number will never be greater than 2
#
days=`expr $upt / 8640000`

if [ $days -ge 2 ]
then
#	
#	return code -1 means reboot
#
	exit -1
fi

exit 0