Skip to content

Instantly share code, notes, and snippets.

@Saren-Arterius
Last active March 18, 2018 07:01
Show Gist options
  • Save Saren-Arterius/0df9f9fc84113323f5bf3442b75538a7 to your computer and use it in GitHub Desktop.
Save Saren-Arterius/0df9f9fc84113323f5bf3442b75538a7 to your computer and use it in GitHub Desktop.
Ecryptfs mount timeout
#!/bin/bash
TIMEOUT_SECONDS=900
PRIVATE_PATH=/home/`whoami`/Private
ecryptfs-mount-private &&
while true; do
timeout ${TIMEOUT_SECONDS} inotifywait ${PRIVATE_PATH} || (echo "Timeout" && ecryptfs-umount-private && break)
t=`stat -f -c %T ${PRIVATE_PATH}`
if [[ "${t}" != "ecryptfs" ]]; then
echo "Not ecryptfs, exiting"
break
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment