群辉dsm6.X自动获取每日必应壁纸并设置为壁纸
7.x不可用 7.x不可用 7.x不可用
脚本添加到群辉任务计划里即可,名字和定时运行自己自定义
此脚本运行后,登录界面和壁纸都会变成必应每日壁纸,登录界面左上角标题也会相应改变
savepath="/volume1/wallpaper"
pic=$(wget -t 5 --no-check-certificate -qO- "https://www.bing.com/HPImageArchive.aspx?format=js&idx=0&n=1")
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
cp -f $tmpfile /usr/syno/synoman/webman/resources/images/default_wallpaper/01.jpg &>/dev/null
cp -f $tmpfile /usr/syno/synoman/webman/resources/images/default/1x/default_wallpaper/dsm6_01.jpg &>/dev/null
cp -f $tmpfile /usr/syno/synoman/webman/resources/images/default/2x/default_wallpaper/dsm6_01.jpg &>/dev/null
cp -f $tmpfile /usr/syno/synoman/webman/resources/images/default/1x/default_wallpaper/dsm6_02.jpg &>/dev/null
cp -f $tmpfile /usr/syno/synoman/webman/resources/images/default/2x/default_wallpaper/dsm6_02.jpg &>/dev/null
title=$(echo $pic|sed 's/.\+"title":"//g'|sed 's/".\+//g')
copyright=$(echo $pic|sed 's/.\+"copyright[:" ]\+//g'|sed 's/".\+//g')
word=$(echo $copyright|sed 's/(.\+//g')
if [ ! -n "$title" ];then
cninfo=$(echo $copyright|sed 's/,/"/g'|sed 's/,/"/g'|sed 's/(/"/g'|sed 's/ //g'|sed 's/\//_/g'|sed 's/)//g')
title=$(echo $cninfo|cut -d'"' -f1)
word=$(echo $cninfo|cut -d'"' -f2)
fi
sed -i s/login_background_customize=.*//g /etc/synoinfo.conf
echo "login_background_customize="yes"">>/etc/synoinfo.conf
sed -i s/login_welcome_title=.*//g /etc/synoinfo.conf
echo "login_welcome_title="$title"">>/etc/synoinfo.conf
sed -i s/login_welcome_msg=.*//g /etc/synoinfo.conf
echo "login_welcome_msg="$word"">>/etc/synoinfo.conf
if (echo $savepath|grep -q '/') then
cp -f $tmpfile $savepath/$date@$title-$word.jpg
fi
rm -rf /tmp/*_bing.jpg
如果运行后没有更换壁纸,可以先试试在自定义壁纸里随便设置一张壁纸再运行
文章目录
关闭
russian bet
Im obliged for the blog. Much thanks again. Really Cool. Efren Mountain
Looking for sex tonight in your area
Thank you ever so for you blog. Really thank you! Great. Brian Baswell
bahis
Way cool! Some extremely valid points! I appreciate you penning this article and also the rest of the site is also really good. Kaila Gunther Ubald
מגוון דירות דיסקרטיות בירושלים
Next time I read a blog, Hopefully it wont fail me as much as this one. After all, Yes, it was my choice to read through, however I truly thought you would probably have something useful to talk about. All I hear is a bunch of complaining about something you can fix if you were not too busy seeking attention.