cd /home/Whale3070.github.io/_posts sed -i 's/\https://raw.githubusercontent.com/Whale3070/Whale3070.github.io/master/img/04-12-04/https:\/\/raw.githubusercontent.com\/Whale3070\/Whale3070.github.io\/master\/img\/'${pic}'/g'${time}-x.md python /root/tool/mark.py /home/Whale3070.github.io/img/${pic}
sed -i '1 i---'${time}-x.md sed -i "2 ititle: ${mdname}"${time}-x.md sed -i '3 icategories:'${time}-x.md sed -i "4 i- $itype"${time}-x.md sed -i '5 itags:'${time}-x.md sed -i "6 i- $itype"${time}-x.md sed -i "7 i---"${time}-x.md
mark.py
/root/tool/i.png,是水印图片
1 2 3 4 5 6 7 8 9 10 11 12
import png import Image import sys import os
wpath = sys.argv[1]
filelist = os.listdir(wpath) for filename in filelist: png_path = wpath+"/"+filename mark = Image.open("/root/tool/i.png") png.water(png_path,mark)