diff options
author | Fredrik Domeij <fredrik.domeij@umu.se> | 2022-08-18 16:24:01 +0200 |
---|---|---|
committer | Fredrik Domeij <fredrik.domeij@umu.se> | 2022-08-18 16:24:01 +0200 |
commit | c718c3e488701d5253e5c79e398a670449ec3e7f (patch) | |
tree | 135995c57be3ad345eaafa149900fd647fd8c450 /scripts/remove_entity.sh | |
parent | 88925828b8a5c71c25582bd650e3ec0d7b572314 (diff) |
Support showEntity= link in scripts/remove_entity.sh, error handling fix
Diffstat (limited to 'scripts/remove_entity.sh')
-rwxr-xr-x | scripts/remove_entity.sh | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/scripts/remove_entity.sh b/scripts/remove_entity.sh index 2de5d0ba..98056013 100755 --- a/scripts/remove_entity.sh +++ b/scripts/remove_entity.sh @@ -1,4 +1,11 @@ #!/bin/bash + +error() +{ + echo "Error: $*" + exit 1 +} + if [ -z "$1" ]; then echo "$0 <Filename / id from metadata to remove>" exit @@ -13,6 +20,9 @@ else [0-9][0-9]*) url="https://metadata.swamid.se/?rawXML=${metadataurl}" ;; + https://metadata.swamid.se/?showEntity=*) + url=$(echo "$metadataurl" | sed 's;showEntity;rawXML;') + ;; esac metadata=`curl -L -m 5 -s -k -f "${url}"` |