-
Notifications
You must be signed in to change notification settings - Fork 4
/
fetch_cape.sh
15 lines (13 loc) · 768 Bytes
/
fetch_cape.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/bash
urle () { [[ "${1}" ]] || return 1; local LANG=C i x; for (( i = 0; i < ${#1}; i++ )); do x="${1:i:1}"; [[ "${x}" == [a-zA-Z0-9.~-] ]] && echo -n "${x}" || printf '%%%02X' "'${x}"; done; echo; }
# username and password input
echo -e "\nYou need to register CAPE via https://icon.is.tue.mpg.de/"
read -p "Username (CAPE):" username
read -p "Password (CAPE):" password
username=$(urle $username)
password=$(urle $password)
# CAPE downloading
echo -e "\nDownloading CAPE testset for ICON..."
wget --post-data "username=$username&password=$password" 'https://download.is.tue.mpg.de/download.php?domain=cape&resume=1&sfile=icon_test.zip' -O './data/icon_test.zip' --no-check-certificate --continue
unzip ./data/icon_test.zip -d ./data/
rm ./data/icon_test.zip