Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- lastRan=$(head ran)
- today=$(date +%j)
- if [ $lastRan -ne $today ]; then
- url=http://apod.nasa.gov/apod/
- prefix=ch_
- if [ $# -gt 0 ]; then
- url=$1
- fi
- imageurl=`curl $url 2> /dev/null | grep "<a href=\"image" | cut -d\" -f2`
- filename=`echo $imageurl | cut -d/ -f3`
- curl http://apod.nasa.gov/apod/$imageurl -o $filename 2> /dev/null
- size=`identify $filename | cut -d' ' -f3`
- cp $filename ./apod/$filename
- convert chblank.png -resize $size tmp_resize_chblank.png
- composite -gravity south tmp_resize_chblank.png $filename $prefix$filename
- rm tmp*
- #echo "Composite image created: $prefix$filename"
- feh --bg-scale ./$prefix$filename
- date +%j > ran
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement