-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add script to download WinCC OA from ETM Portal
- Loading branch information
0 parents
commit 7aecfca
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/bash | ||
|
||
# File containing the HTML content | ||
HTML_FILE="Downloads.html" | ||
|
||
# Define the base URL | ||
BASE_URL="https://www.winccoa.com" | ||
|
||
OUTPUT_FILE="WinCC_OA.zip" | ||
|
||
PATCH_NUM="p007" | ||
|
||
curl -o "$HTML_FILE" -c cookie.txt -d "user=${USERNAME}&pass=${PASSWORD}&logintype=login" -X POST "${BASE_URL}/index.html?tx_felogin_login%5Baction%5D=login&tx_felogin_login%5Bcontroller%5D=Login&cHash=c7468a0d2aa90b33b574ad5ad452c085" | ||
|
||
curl -o "$HTML_FILE" -b cookie.txt "${BASE_URL}/downloads/detail/wincc-oa-319-${PATCH_NUM}-debian-11-bullseye.html" | ||
|
||
# Extract the relative URL | ||
RELATIVE_URL=$(grep "Download ZIP File" $HTML_FILE | grep -v "arm64" | sed -n 's/.*href="\([^"]*\).*/\1/p' | sed 's/\&/\&/g') | ||
|
||
# Create the full URL | ||
FULL_URL="${BASE_URL}${RELATIVE_URL}" | ||
|
||
echo "Downloading $FULL_URL to $OUTPUT_FILE" | ||
# Specify the output filename | ||
|
||
# Download the file with verbose output | ||
curl -o "$OUTPUT_FILE" -b cookie.txt "$FULL_URL" | ||
|
||
echo "Downloaded to $OUTPUT_FILE" |