Nolhay's Homebrew Morning Bash Alarm

Intro
I use this Bash Script to wake up in the morning

The Code

 * 1) !/bin/bash

WBNG='http://24.97.223.13/wbng2/closings/sch.html' LOCAL='/home/Einstein/sch.html' MSTR_SOURCE="$WBNG" DUMP='/home/Einstein/closings_dump'
 * 1) Sources
 * 1) End Sources

function check_one {	if [ "$( grep -i "ChenangoForks" $DUMP )" = "ChenangoForksSchoolDistrictOneHourDelay" ] ;then if [ "$(date +%H%M)" -ge 0530 ] && [ "$(date +%H%M)" -le 0600 ]; then sleep 1h rm $DUMP check_one fi if [ "$(date +%H%M)" -ge 0630 ] && [ "$(date +%H%M)" -le 0700 ]; then start_day fi else check_two fi }
 * 1) Find a One Hour Delay
 * 1) End One Hour Delay

function check_two {	if [ "$( grep -i "ChenangoForks" $DUMP )" = "ChenangoForksSchoolDistrictTwoHourDelay" ] ;then if [ "$(date +%H%M)" -ge 0530 ] && [ "$(date +%H%M)" -le 0600 ]; then sleep 2h rm $DUMP check_one fi if [ "$(date +%H%M)" -ge 0630 ] && [ "$(date +%H%M)" -le 0700 ]; then sleep 1h rm $DUMP check_one fi if [ "$(date +%H%M)" -ge 0730 ] && [ "$(date +%H%M)" -le 0800 ]; then start_day fi else check_close fi }
 * 1) Find a Two Hour Delay
 * 1) End Two Hour Delay

function check_close {	if [ "$( grep -i "ChenangoForks" $DUMP )" = "ChenangoForksSchoolDistrictClosed" ] ;then rm $DUMP exit 0 else start_day fi }
 * 1) Find a Cancellation
 * 1) End Cancellation

function start_day {	#Turn monitors & music on; adjust volume xset dpms force on		dcop kmix Mixer0 setMasterVolume 50 dcop amarok player setVolume 50 amarok --play #Open today's weather page firefox "http://www.wunderground.com/cgi-bin/findweather/getForecast?query=13744" #wait till I get out of shower sleep 15m dcop kmix Mixer0 setMasterVolume 50 #This runs at X:00 Turn monitors & music off sleep 60m amarok --stop xset dpms force off #Clean up, clean up everybody do their share rm $DUMP exit 0 }
 * 1) No Delay
 * 1) START MORNING#####

if [ "$(date +%H%M)" -ge 0530 ] && [ "$(date +%H%M)" -le 0800 ]; then #Log results echo "$(date +%x@%X) success" >> .sch_grep_results.txt #Create a dumpfile w3m -dump $MSTR_SOURCE | tr -d [:blank:] > $DUMP #Begin Delay Checking check_one else #Log results echo "$(date +%x@%X) ***FAILED***" >> .sch_grep_results.txt exit 0 fi