- Stuff
- Monday, December 24th, 2007 at 4:20:43pm MST
- #!/bin/bash
- #Sources
- WBNG='http://**.**.***.**/*****/closings/sch.html'
- LOCAL='/home/User/sch.html'
- MSTR_SOURCE="$LOCAL"
- DUMP='/home/User/closings_dump'
- #End Sources
- #Create a dumpfile
- w3m -dump $MSTR_SOURCE > $DUMP
- #Find a One Hour Delay
- function check_one
- {
- if [ "$( grep -i "School Name" $DUMP )" = " School Name School District One Hour Delay" ] ;then
- if [ "$(date +%H%M)" = "0545" ] ;then
- sleep 1h
- rm $DUMP
- check_one
- fi
- if [ "$(date +%H%M)" = "0645" ] ;then
- start_day
- else
- check_two
- fi
- fi
- }
- #End One Hour Delay
- #Find a Two Hour Delay
- function check_two
- {
- if [ "$( grep -i "School Name" $DUMP )" = " School Name School District Two Hour Delay" ] ;then
- if [ "$(date +%H%M)" = "0545" ] ;then
- sleep 2h
- rm $DUMP
- check_one
- fi
- if [ "$(date +%H%M)" = "0745" ] ;then
- start_day
- else
- check_close
- fi
- }
- #End Two Hour Delay
- #Find a Cancellation
- function check_close
- {
- if [ "$( grep -i "School Name" $DUMP )" = " School Name School District Closed" ] ;then
- rm $DUMP
- exit 0
- else
- start_day
- fi
- }
- #End Cancellation
- #No Delay
- function start_day
- {
- ####START MORNING#####
- #Turn monitors & music on (norm 5:45am)
- xset dpms force on
- amarokapp --play
- #Open today's weather page
- firefox "http://www.wunderground.com/cgi-bin/findweather/getForecast?query=*****"
- #Send a TXT to 1st person
- #dcopref=`dcop kmail KMailIface openComposer "address" "" "" "subject" "message" false`
- #dcop "$dcopref" send 1
- #These next few lines need to run at 6:20am
- #dcopref=`dcop kmail KMailIface openComposer "address" "" "" "subject" "message" false`
- #dcop "$dcopref" send 1
- #This runs at 7:00am Turn monitors & music off
- #amarokapp --stop
- #xset dpms force off
- #Clean up
- rm $DUMP
- exit 0
- }
- #Begin Delay Checking
- check_one
advertising
Update the Post
Either update this post and resubmit it with changes, or make a new post.
You may also comment on this post.
Please note that information posted here will expire by default in one month. If you do not want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords. All illegal activities will be reported and any information will be handed over to the authorities, so be good.