#!/bin/bash
# This script downloads and installs uptimed.
# This also starts it automatically on boot.
# Newest version @ http://linux.dayid.org/scripts/uptimed.sh
# dayid@dayid.org for comments/concerns.
# -- Last Revision: 2007/04/30
# -- 2008/09/10: changed -m 50 to -m 0
install=uptimed-0.3.11
pwd=`pwd`
cd /root/
wget http://pub.dayid.org/installs/${install}.tar.bz2 
tar -xvjf ${install}.tar.bz2
rm -f ${install}.tar.bz2
cd ${install}
./configure
make
make install
cd ..
rm -rf ${install}
cd ${pwd}
rm -f uptimed.sh
uptimed -b
uptimed -m 0
echo "#--Added by http://linux.dayid.org/scripts/uptimed.sh --#
/usr/local/sbin/uptimed -b" >> /etc/rc.sysinit
clear
echo "Automatically added to rc.sysinit to activate on boot:"
tail -n 2 /etc/rc.sysinit
echo "#-- Added by http://linux.dayid.org/scripts/uptimed.sh --#
/usr/local/sbin/uptimed -bm 0" >> /etc/rc.local
echo "Automatically added to rc.local to activate on boot:"
tail -n 2 /etc/rc.local
echo ""
echo "Yay! uptimed (and uprecords) are now installed."
uprecords

