Skip to content

Commit

Permalink
Fixed Freesurfer install script
Browse files Browse the repository at this point in the history
  • Loading branch information
maouw committed Oct 18, 2023
1 parent c3b6965 commit 8bf768c
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions scripts/install-freesurfer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ fi

if [ -z "${FREESURFER_DOWNLOAD_URL:-}" ]; then
if command -v dpkg >/dev/null 2>&1; then
# Is Debian/Ubuntu. Package filename looks like turbovnc_3.0.91_arm64.deb
# Is Debian/Ubuntu.
arch="$(dpkg --print-architecture)"
if [ -r /etc/os-release ]; then
. /etc/os-release
Expand All @@ -38,7 +38,7 @@ if [ -z "${FREESURFER_DOWNLOAD_URL:-}" ]; then
}
filename="freesurfer_ubuntu${ubuntu_major_version}-${FREESURFER_VERSION}_${arch}.deb"
elif command -v yum >/dev/null 2>&1; then
# Is RHEL/CentOS/Rocky. Package filename looks like turbovnc-3.0.91.x86_64.rpm
# Is RHEL/CentOS/Rocky
arch="$(uname -m)"
if [ -r /etc/os-release ]; then
. /etc/os-release
Expand Down Expand Up @@ -69,8 +69,13 @@ if [ -z "${FREESURFER_DOWNLOAD_URL:-}" ]; then
FREESURFER_DOWNLOAD_URL="${FREESURFER_DOWNLOAD_ROOT}/${filename}"
fi

echo "Downloading ${TURBOVNC_DOWNLOAD_URL}..."
dlpath=$(curl -w "%{filename_effective}" -fLO "${TURBOVNC_DOWNLOAD_URL}")
[ -z "${FREESURFER_DOWNLOAD_URL:-}" ] && {
echo >&2 "error: cannot determine download URL"
exit 1
}

echo "Downloading ${FREESURFER_DOWNLOAD_URL}..."
dlpath=$(curl -w "%{filename_effective}" -fLO "${FREESURFER_DOWNLOAD_URL}")
trap 'rm -f "${dlpath:-}"' INT QUIT TERM EXIT

if [ -r "${dlpath}" ]; then
Expand Down

0 comments on commit 8bf768c

Please sign in to comment.