Skip to content

Commit

Permalink
Address shellcheck issues
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidHuber-NOAA committed Jan 24, 2025
1 parent 3205260 commit 3078ace
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions parm/globus/run_doorman.sh.j2
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env bash
set -eu

# This script runs on Niagara to interact with the Doorman service
subdir="{{PSLOT}}/{{RUN}}/{{jobid}}"
Expand Down Expand Up @@ -40,7 +41,7 @@ fi
# Parse the FLIST file created by receive.sh to get the transfer IDs
IDs=""
while IFS= read -r line; do
package_name=$(grep -o "package_location_.*\.tgz")
package_name=$(echo "${line}" | grep -o "package_location_.*\.tgz")
tmp="${package_name#package_location_}"
ID="${tmp%.tgz}"
IDs="${IDs} ${ID}"
Expand All @@ -55,6 +56,7 @@ for ID in ${IDs}; do
done

# Send the acknowledgement back to the sender
set +e
send.sh

stat=$?
Expand All @@ -63,10 +65,12 @@ if [[ ${stat} -ne 0 ]]; then
echo "Failed to send status back to client!"
exit 3
fi
set -e

# Remove the working directory
#shellcheck ignore=SC2050
if [[ "{{KEEPDATA}}" == "NO" ]]; then
cd "${HOME}"
cd "${HOME}" || echo "Failed to navigate to ${HOME}!" && exit 4
rm -rf "${doorman_dir}"
fi

Expand Down

0 comments on commit 3078ace

Please sign in to comment.