New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
新版图片下载下来是0kb #7
Comments
壁纸更换是否成功?保存路径是否和Filestation一致? |
壁纸更换成功,但是是纯白背景。 |
文件大小是0kb,文件名有完整标题吗 |
有 |
那首页的欢迎语应该也没问题吧? |
是的 |
登录背景和桌面背景都是纯白色。 |
我测试了正则,好像没问题 |
没日志的话跑下面这段试试。 savepath="/volume1/wallpaper"
pic=$(wget -t 5 --no-check-certificate -qO- "https://www.bing.com/HPImageArchive.aspx?format=js&idx=0&n=1")
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"
touch $savepath/bing.log
wget -t 5 --no-check-certificate $link -O $tmpfile -o $savepath/bing.log
echo $link >>$savepath/bing.log
echo $date >>$savepath/bing.log
echo $tmpfile >>$savepath/bing.log
echo $pic >>$savepath/bing.log |
日志: 好了,文件也下载下来了,应该是少个fi |
我把if那行去掉了啊(已编辑,可能你手快复制了之前的)。。你还是跑上面那段看看。。 |
100K .......... .......... .......... .......... .......... 44% 12.5M 0s 2019-03-12 10:53:26 (2.75 MB/s) - '/tmp/20190312_bing.jpg' saved [346085/346085] https://www.bing.com/th?id=OHR.SpainRioTinto_ZH-CN9632593185_1920x1080.jpg&rf=NorthMale_1920x1080.jpg&pid=hp |
看起来工作非常正常啊,那再试试这个,会把图片复制到savepath: savepath="/volume1/wallpaper"
pic=$(wget -t 5 --no-check-certificate -qO- "https://www.bing.com/HPImageArchive.aspx?format=js&idx=0&n=1")
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"
touch $savepath/bing.log
wget -t 5 --no-check-certificate $link -O $tmpfile -o $savepath/bing.log
echo $link >>$savepath/bing.log
echo $date >>$savepath/bing.log
echo $tmpfile >>$savepath/bing.log
echo $pic >>$savepath/bing.log
copyright=$(echo $pic|sed 's/.\+"copyright[:" ]\+//g'|sed 's/".\+//g')
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)
cp -f $tmpfile $savepath/$date@$title-$word.jpg
echo $date@$title-$word.jpg >>$savepath/bing.log |
我找到问题了,去掉一个if fi就好了,虽然不懂为啥。。。。修改后如下:
|
谢谢 @kkkgo |
那就怪了 按逻辑来说如果这个判断出问题脚本应该什么事都不会做才对 |
那是不是群晖的bug。。。我现在确实可以了 |
试试这个 #如需收集每日美图去掉下面注释设置保存文件夹路径
#savepath="/volume1/wallpaper"
#在FileStation里面右键文件夹属性可以看到路径
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 |
如题
The text was updated successfully, but these errors were encountered: