Skip to content

Commit

Permalink
Update ChangeBing.sh
Browse files Browse the repository at this point in the history
fix #7
  • Loading branch information
kkkgo committed Mar 14, 2019
1 parent 6db2e4e commit 2e66424
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ChangeBing.sh
Expand Up @@ -2,11 +2,12 @@
#savepath="/volume1/wallpaper"
#在FileStation里面右键文件夹属性可以看到路径
pic=$(wget -t 5 --no-check-certificate -qO- "https://www.bing.com/HPImageArchive.aspx?format=js&idx=0&n=1")
if (echo $pic|grep -q enddate) then
echo $pic|grep -q enddate||exit
link=$(echo https://www.bing.com$(echo $pic|sed 's/.\+"url"[:" ]\+//g'|sed 's/".\+//g'))
date=$(echo $pic|sed 's/.\+enddate[": ]\+//g'|grep -Eo 2[0-9]{7}|head -1)
tmpfile=/tmp/$date"_bing.jpg"
wget -t 5 --no-check-certificate $link -qO $tmpfile
[ -s $tmpfile ]||exit
rm -rf /usr/syno/etc/login_background*.jpg
cp -f $tmpfile /usr/syno/etc/login_background.jpg &>/dev/null
cp -f $tmpfile /usr/syno/etc/login_background_hd.jpg &>/dev/null
Expand All @@ -32,5 +33,4 @@ echo "login_welcome_msg=\"$word\"">>/etc/synoinfo.conf
if (echo $savepath|grep -q '/') then
cp -f $tmpfile $savepath/$date@$title-$word.jpg
fi
fi
rm -rf /tmp/*_bing.jpg

0 comments on commit 2e66424

Please sign in to comment.