mpup 1021 B

1234567891011121314151617181920212223242526272829303132333435
  1. #!/bin/sh
  2. ### Overall revision 6 ###
  3. # this is a script to update mplayer,
  4. # and say if it was updated...
  5. OLD_HIST=`cat /.mplayer/up_hist`
  6. OLD_VER=`cat /.mplayer/up_data`
  7. if [ OLD_HIST ]; then
  8. #this runs if the last time it was run it worked
  9. ### bubble one ###
  10. cd /mplayer/
  11. svn update|tee /.mplayer/up_hist
  12. cd -
  13. 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'`
  14. if [ $OLD_VER != $NEW_VER ]; then
  15. growlnotify -m "mplayer updated"
  16. echo $NEW_VER>/.mplayer/up_data
  17. else
  18. growlnotify -m "mplayer has not been updated"
  19. fi
  20. ### end one ###
  21. else
  22. #this runs if last time failed
  23. ### bubble two ###
  24. cd /mplayer
  25. svn update|tee /.mplayer/up_hist
  26. cd -
  27. 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
  28. ### end two ###
  29. fi
  30. date "+%H:%M:%S, %a %b%e %Y">/.mplayer/up_date