Last active
August 29, 2015 14:14
-
-
Save skatsuta/ec82132467925763922b to your computer and use it in GitHub Desktop.
Script that manages to mount and unmount external HFS+ USB drive on Linux
This file contains 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
#!/usr/bin/env bash | |
CMD=`basename $0` | |
usage() { | |
echo "Usage: ${CMD} on|off" | |
} | |
if [[ $# -eq 0 ]]; then | |
usage | |
exit 1 | |
fi | |
case "$1" in | |
on) | |
sudo mount -t hfsplus -o force,rw /dev/sda2 /media/usbhdd | |
;; | |
off) | |
sudo umount /media/usbhdd | |
;; | |
*) | |
usage | |
exit 1 | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment