Skip to content
Snippets Groups Projects
Commit 97bfde0d authored by Administrator's avatar Administrator
Browse files

Update empty.sh, trap.sh files

parent 163afef9
No related branches found
No related tags found
No related merge requests found
Pipeline #401 passed with stage
in 4 seconds
#! /usr/bin/env sh
DEST=${AWS_S3_MOUNT:-/opt/s3fs/bucket}
. trap.sh
tail -f /dev/null
trap.sh 0 → 100644
exit_script() {
SIGNAL=$1
echo "Caught $SIGNAL! Unmounting ${DEST}..."
fusermount -uz ${DEST}
s3fs=$(ps -o pid= -o comm= | grep s3fs | sed -E 's/\s*(\d+)\s+.*/\1/g')
if [ -n "$s3fs" ]; then
echo "Forwarding $SIGNAL to $s3fs"
kill -$SIGNAL $s3fs
fi
trap - $SIGNAL # clear the trap
exit $?
}
trap "exit_script INT" INT
trap "exit_script TERM" TERM
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment