Skip to content

Instantly share code, notes, and snippets.

@tdtgit
Created May 1, 2018 12:34
Show Gist options
  • Save tdtgit/ad37a81e60cf07a61c867019109c85c4 to your computer and use it in GitHub Desktop.
Save tdtgit/ad37a81e60cf07a61c867019109c85c4 to your computer and use it in GitHub Desktop.

Revisions

  1. tdtgit created this gist May 1, 2018.
    21 changes: 21 additions & 0 deletions warmup.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,21 @@
    #!/bin/bash
    #
    # Written by AC - 2015 <[email protected]> - sys0dm1n.com
    #
    URL=$1

    wget --quiet http://$URL/sitemap.xml --no-cache --output-document - | egrep -o "http(s?)://$URL[^ \"\'()\<>]+" | while read line; do
    if [[ $line == *.xml ]]
    then
    newURL=$line
    wget --quiet $newURL --no-cache --output-document - | egrep -o "http(s?)://$URL[^ \"\'()\<>]+" | while read newline; do
    curl -s -S -H "accept-encoding: gzip, deflate, br" -A 'Cache Warmer' -sL $newline -o /dev/null 2>&1
    # echo $newline
    done
    else
    curl -s -S -H "accept-encoding: gzip, deflate, br" -A 'Cache Warmer' -sL $line -o /dev/null 2>&1
    # echo $line
    fi
    done
    echo "Done $URL";
    exit