How do I determine if a web page exists with shell scripting?

前端 未结 5 436
时光取名叫无心
时光取名叫无心 2020-12-02 06:14

I am trying to make a program that can convert a series of manga scans into one pdf file, and I don\'t want to have to attempt to download the picture to determine if I have

5条回答
  •  执念已碎
    2020-12-02 07:10

    First make sure there is no authorization issue.If any Authorization Required , you provide the username and password .Create a shell script file (checkURL.sh ) and paste the below code.

    Hope this will help you.

    checkURL.sh

    yourURL="http://abc-repo.mycorp.com/data/yourdir"
    
    if curl --output /dev/null --silent --head --fail "$yourURL"
    then
        echo "This URL Exist"
    else
        echo "This URL Not Exist"
    fi
    

    Its working for me in Nexus and other Repository.

提交回复
热议问题