Skip to content

Commit

Permalink
init script
Browse files Browse the repository at this point in the history
  • Loading branch information
f-peverali committed Jan 4, 2024
1 parent fa62b65 commit ff9e176
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions scripts/export-IG.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash

# URL of the file to download
url="https://simplifier.net/guide/implementierungsleitfaden-isik-modul-dokumentenaustausch-stufe-3/$exportaszipui"

# Folder to save the downloaded files
download_folder="downloaded_files"

# Create the download folder if it doesn't exist
mkdir -p "$download_folder"

# Use curl to download the file and follow redirects, saving the file with the correct name
#-L: Follow redirects.
# -J: Save the file with the server-specified name or the last part of the URL.
curl -LJO "$url"

# Check if the download was successful
if [ $? -eq 0 ]; then
# Get the downloaded filename
filename=$(ls -1 | grep "Implementierungsleitfaden*.zip" | head -n 1)

# Move the downloaded file to the specified folder
mv "$filename" "$download_folder/"

echo "File downloaded successfully and saved to: $download_folder/$filename"
else
echo "Error downloading the file."
fi

0 comments on commit ff9e176

Please sign in to comment.