Created
April 13, 2019 06:24
-
-
Save x7c1/58044c5452b1f8fa8495f5b928485c9b to your computer and use it in GitHub Desktop.
suspend after google-drive directories unmounted.
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/sh | |
| set -eu | |
| GOOGLE_DRIVE_TARGETS=$( | |
| findmnt --source google-drive-ocamlfuse --json | | |
| jq -r '.filesystems[].target' | |
| ) | |
| if [ -z ${GOOGLE_DRIVE_TARGETS} ]; then | |
| echo "not mounted: google-drive-ocamlfuse" | |
| else | |
| for target in ${GOOGLE_DRIVE_TARGETS} | |
| do | |
| echo "unmounting: ${target}" | |
| fusermount -u ${target} | |
| done | |
| fi | |
| echo "suspending..." | |
| sleep 0.5 | |
| echo mem > /sys/power/state |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment