Last active
March 18, 2018 07:01
-
-
Save Saren-Arterius/0df9f9fc84113323f5bf3442b75538a7 to your computer and use it in GitHub Desktop.
Ecryptfs mount timeout
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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