From 0fd75ab63a53780f0ad54f0dd9aa95ce4b24a470 Mon Sep 17 00:00:00 2001 From: Robert Castley Date: Thu, 6 Nov 2025 19:27:02 +0000 Subject: [PATCH] Reduce the number of vars being used and adhere to the RELEASE var only. --- install/splunk-enterprise-install.sh | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/install/splunk-enterprise-install.sh b/install/splunk-enterprise-install.sh index 538b9d322..fd14a19c0 100644 --- a/install/splunk-enterprise-install.sh +++ b/install/splunk-enterprise-install.sh @@ -43,21 +43,19 @@ while true; do esac done -URL="https://www.splunk.com/en_us/download/splunk-enterprise.html" -DEB_URL=$(curl -s "$URL" | grep -o 'data-link="[^"]*' | sed 's/data-link="//' | grep "https.*products/splunk/releases" | grep "\.deb$") -VERSION=$(echo "$DEB_URL" | sed 's|.*/releases/\([^/]*\)/.*|\1|') -DEB_FILE="splunk-enterprise.deb" +DOWNLOAD_URL=$(curl -s "https://www.splunk.com/en_us/download/splunk-enterprise.html" | grep -o 'data-link="[^"]*' | sed 's/data-link="//' | grep "https.*products/splunk/releases" | grep "\.deb$") +RELEASE=$(echo "$DOWNLOAD_URL" | sed 's|.*/releases/\([^/]*\)/.*|\1|') msg_info "Downloading Splunk Enterprise" -$STD curl -fsSL -o "$DEB_FILE" "$DEB_URL" || { +$STD curl -fsSL -o "splunk-enterprise.deb" "$DOWNLOAD_URL" || { msg_error "Failed to download Splunk Enterprise from the provided link." exit 1 } -msg_ok "Downloaded Splunk Enterprise v${VERSION}" +msg_ok "Downloaded Splunk Enterprise v${RELEASE}" msg_info "Installing Splunk Enterprise" -$STD dpkg -i "$DEB_FILE" -msg_ok "Installed Splunk Enterprise v${VERSION}" +$STD dpkg -i "splunk-enterprise.deb" +msg_ok "Installed Splunk Enterprise v${RELEASE}" msg_info "Creating Splunk admin user" SPLUNK_HOME="/opt/splunk"