Skip to content

Instantly share code, notes, and snippets.

@t-bltg
t-bltg / cas-get.sh
Created December 1, 2024 16:14 — forked from dodok1/cas-get.sh
script to load CAS protected content using curl (based on http://ecmsimon.wordpress.com/2011/07/11/automated-e2e-testing-of-alfresco-through-cas/)
# Usage: cas-get.sh {url} {username} {password} # If you have any errors try removing the redirects to get more information
# The service to be called, and a url-encoded version (the url encoding isn't perfect, if you're encoding complex stuff you may wish to replace with a different method)
DEST="$1"
ENCODED_DEST=`echo "$DEST" | perl -p -e 's/([^A-Za-z0-9])/sprintf("%%%02X", ord($1))/seg' | sed 's/%2E/./g' | sed 's/%0A//g'`
#IP Addresses or hostnames are fine here
CAS_HOSTNAME=team.eea.sk
#Authentication details. This script only supports username/password login, but curl can handle certificate login if required
USERNAME=$2