Skip to content

Commit

Permalink
Fix entrypoint file move exception handling
Browse files Browse the repository at this point in the history
  • Loading branch information
hmakelin committed Feb 28, 2024
1 parent 4e79436 commit 2ab198e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions docker/apache/mapserver/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ process_directory_change() {
fi
fi

sleep 0.5

if [[ "$BASENAME" =~ \.(tif|tiff|jp2|ecw|img)$ ]]; then
echo "Raster file detected, regenerating VRT."
cd /etc/mapserver && gdalbuildvrt "$VRT_FILE" "$DIR_PATH"/*.tif "$DIR_PATH"/*.tiff "$DIR_PATH"/*.jp2 "$DIR_PATH"/*.ecw "$DIR_PATH"/*.img
Expand All @@ -69,7 +71,7 @@ done &

# Move demo imagery and DEM over to shared volume if still on image
# This should trigger the inotify script
mv /etc/mapserver/$NAIP_ZIP_FILENAME $IMAGERY_DIR | echo "NAIP imagery not found on container - likely already moved to shared volume"
mv /etc/mapserver/$DEM_FILENAME $DEM_DIR | echo "USGS DEM not found on container - likely already moved to shared volume"
mv /etc/mapserver/$NAIP_ZIP_FILENAME $IMAGERY_DIR || echo "NAIP imagery not found on container - likely already moved to shared volume"
mv /etc/mapserver/$DEM_FILENAME $DEM_DIR || echo "USGS DEM not found on container - likely already moved to shared volume"

exec "$@"
4 changes: 2 additions & 2 deletions docker/gscam/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -e
source "/opt/ros/$ROS_VERSION/setup.bash"

# Move config files to shared volume if not yet done
mv /gscam_params.yaml /etc/gscam | echo "INFO: gscam_params.yaml not found on container - likely already moved to shared volume"
mv /camera_calibration.yaml /etc/gscam | echo "INFO: camera_calibration.yaml on container - likely already moved to shared volume"
mv /gscam_params.yaml /etc/gscam || echo "INFO: gscam_params.yaml not found on container - likely already moved to shared volume"
mv /camera_calibration.yaml /etc/gscam || echo "INFO: camera_calibration.yaml on container - likely already moved to shared volume"

exec "$@"

0 comments on commit 2ab198e

Please sign in to comment.