I am trying to setup a page that redirects to an sh file so I don't have to lookup the actual URL when I need it, but I can't get curl to follow the redirect even when using -L. what am I doing wrong? The link I am using to redirect is here

  • What are you sending as the "redirect" page? A HTTP 301 response with a Location header is required. – Stephen Harris Jan 31 at 0:42
  • 1
    It would help if you included an (edited) output of curl -L -v http://your_url -o /dev/null into your question. – mosvy Jan 31 at 1:00

Your link is using a html redirect instead of a http redirect so here is a dirty hack;

URL=$(curl -s https://hbiede.com/defaults | grep http | perl -pe 's/.*=(http)/$1/g;s/".*//g')
curl -s "$URL" > defaults.sh 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.