Created
September 12, 2017 11:31
-
-
Save xentec/d1de83a382416f2b513aaa479e91a5bc to your computer and use it in GitHub Desktop.
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 -e | |
| for DEV; do true; done # get last argument | |
| TMPDIR="$(mktemp -d "/mnt/$(basename "$DEV").XXXX")" | |
| mount $* "$TMPDIR" | |
| echo "Mounting $DEV on $TMPDIR" | |
| (cd "$TMPDIR" && su "$SUDO_USER") | |
| echo "Deleting $TMPDIR" | |
| umount "$TMPDIR" | |
| rm -r "$TMPDIR" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment