#!/usr/bin/bash
. /etc/init.d/functions
function check(){
time=`date "+%F %X"`
echo "当前时间:$time"
ip=$(ip a |grep inet |grep "scope global dynamic"|awk -F"/" '{print $1}' |awk '{print $2}')
ping -w1 -c1 www.baidu.com &>/dev/null
if [[ $? -ne 0 ]];then
echo_failure || echo "网络异常,请检查"
else
echo_success && echo "网络正常 当前IP:$ip"
fi
yum repolist &>/dev/null
if [[ $? -ne 0 ]];then
echo_failure || echo "yum异常,请检查"
fi
}
function down(){
yum install -y wget &>/dev/null
w=`echo "$1" |tr -d '\n' |od -An -tx1|tr ' ' %`
data=$(curl -s "https://image.baidu.com/search/index?tn=baiduimage&word=$w")
echo $data | grep -P -o "https://ss.*?.jpg" | sort -n -r |uniq >> $2/url2.txt
a=0
while read line
do
sleep 1
code=$(curl -I "$line" 2>/dev/n
shell脚本实现获取图片
最新推荐文章于 2024-07-21 12:06:11 发布
本文介绍如何利用Shell脚本进行批量图片处理,包括获取、重命名和转换图片格式等操作,帮助提升工作效率。
摘要由CSDN通过智能技术生成