fix exists/not exists case
This commit is contained in:
parent
97711acf36
commit
3e3caba6d1
2
apod.sh
2
apod.sh
@ -2,8 +2,8 @@
|
|||||||
NASA_APOD_BASE_URL="https://apod.nasa.gov/apod"
|
NASA_APOD_BASE_URL="https://apod.nasa.gov/apod"
|
||||||
IMAGE_URL=`curl -s $NASA_APOD_BASE_URL/astropix.html | grep -oh 'href="image/.*"' | grep -oh 'image/.*jpg' | head -1`
|
IMAGE_URL=`curl -s $NASA_APOD_BASE_URL/astropix.html | grep -oh 'href="image/.*"' | grep -oh 'image/.*jpg' | head -1`
|
||||||
if [ -z "$IMAGE_URL" ]; then
|
if [ -z "$IMAGE_URL" ]; then
|
||||||
curl -s "$NASA_APOD_BASE_URL/$IMAGE_URL" > image.jpg
|
|
||||||
gsettings set org.gnome.desktop.background picture-uri "file:///home/pi2/Pictures/wallpapers/blue_galaxy_wallpaper.png"
|
gsettings set org.gnome.desktop.background picture-uri "file:///home/pi2/Pictures/wallpapers/blue_galaxy_wallpaper.png"
|
||||||
else
|
else
|
||||||
|
curl -s "$NASA_APOD_BASE_URL/$IMAGE_URL" > image.jpg
|
||||||
gsettings set org.gnome.desktop.background picture-uri "file:///$(pwd)/image.jpg"
|
gsettings set org.gnome.desktop.background picture-uri "file:///$(pwd)/image.jpg"
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user