Created
April 8, 2019 20:11
-
-
Save jfeilbach/f2e28b6c20cf2d3ca5a92e20c8bfdb44 to your computer and use it in GitHub Desktop.
Get splunk universal forwarder download URL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#URL="https://www.splunk.com/en_us/download/splunk-enterprise.html" | |
URL="https://www.splunk.com/en_us/download/universal-forwarder.html" | |
OS_REGEX="linux-2\.6-x86_64\.rpm" | |
#OS_REGEX="Linux-x86_64\.md5" | |
RESPONSE=`curl -s --connect-timeout 10 --max-time 10 $URL` | |
LINK=`echo $RESPONSE | egrep -o "data-link=\"https://[^\"]+-${OS_REGEX}\"" | cut -c12- | rev | cut -c2- | rev` | |
echo $LINK | |
#wget --no-check-certificate -P /tmp $LINK | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment