#!/bin/bash

# Function to unmount remote mounts
function unmount_remote_mounts {
    echo "Unmounting remote mounts..."
    umount -a -t nfs4 -f
}

# Trap signals to ensure unmounting on container stop
trap 'unmount_remote_mounts' SIGTERM SIGINT EXIT

echo "Mounting EFS filesystem ${EFS_DNS_NAME}"
mount -t efs -o tls -o iam "${EFS_DNS_NAME}":/ /mnt/efs

bash
