Skip to content

Commit

Permalink
Change scripts to be a little more cross-platform compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
jennydaman committed Aug 26, 2024
1 parent d83e5b3 commit 2b8f943
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
3 changes: 2 additions & 1 deletion scripts/chrs_login.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/sh -ex
#!/usr/bin/env sh

set -ex
exec chrs login --username chris --password chris1234 --cube http://localhost:8000/api/v1/ --ui http://localhost:8020/api/v1/ --no-keyring
3 changes: 2 additions & 1 deletion scripts/list_mrns.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/bash -e
#!/usr/bin/env bash
# Purpose: list all Patient MRNs inside Orthanc

set -e
set -o pipefail

curl -sfu orthanc:orthanc http://localhost:8042/patients \
Expand Down
8 changes: 5 additions & 3 deletions scripts/upload2orthanc.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env sh
# Purpose: upload a directory of DICOMs to Orthanc.

if ! [ -d "$1" ]; then
Expand All @@ -8,5 +8,7 @@ fi

url="http://localhost:8042/instances"

find -L "$1" -type f -name '*.dcm' \
| parallel --bar -j 4 "curl -sSfX POST -u orthanc:orthanc http://localhost:8042/instances -H Expect: -H 'Content-Type: application/dicom' -T {} -o /dev/null"
exec fd -L --ignore-vcs --ignore-case --type f \
-j 4 \
-x curl -sSfX POST -u orthanc:orthanc "$url" -H 'Expect:' -H 'Content-Type: application/dicom' -T '{}' -o /dev/null \; \
'.+\.dcm$' "$1"

0 comments on commit 2b8f943

Please sign in to comment.