1234567891011121314151617181920212223242526272829303132333435 |
- #!/bin/sh
- ### Overall revision 6 ###
- # this is a script to update mplayer,
- # and say if it was updated...
- OLD_HIST=`cat /.mplayer/up_hist`
- OLD_VER=`cat /.mplayer/up_data`
- if [ OLD_HIST ]; then
- #this runs if the last time it was run it worked
- ### bubble one ###
- cd /mplayer/
- svn update|tee /.mplayer/up_hist
- cd -
- NEW_VER=`echo -n $(grep [0-9] /.mplayer/up_hist|sed 's/[^0-9]*\([0-9]*\)[^0-9]*/\1/g'|sed 's/[0-9]\{4,\}/(&)/g'|grep '('|sed 's/[()]//g')|sed 's/\ //g'`
- if [ $OLD_VER != $NEW_VER ]; then
- growlnotify -m "mplayer updated"
- echo $NEW_VER>/.mplayer/up_data
- else
- growlnotify -m "mplayer has not been updated"
- fi
- ### end one ###
- else
- #this runs if last time failed
- ### bubble two ###
- cd /mplayer
- svn update|tee /.mplayer/up_hist
- cd -
- echo -n `grep "[0-9]" /.mplayer/up_hist|sed "s/[^0-9]*\([0-9]*\)[^0-9]*/\1/"|sed 's/[0-9]\{4,\}/(&)/g'|grep '('|sed 's/[()]//g'`|sed 's/\ //g'>/.mplayer/up_data
- ### end two ###
- fi
- date "+%H:%M:%S, %a %b%e %Y">/.mplayer/up_date
|