Created
November 24, 2016 11:41
-
-
Save danielmelogpi/89c457925ec03f106c2e1fdf70e68aa7 to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
montar() { | |
mount -t vboxsf "$1" "$2" | |
} | |
desmontar() { | |
umount -t vboxsf "$1" | |
} | |
PCSIST="/home/user/pcsist" | |
TMP="/tmp" | |
case $1 in | |
"montar") | |
echo "Montando compartilhamento 'pcsist' em $PCSIST"; | |
desmontar $PCSIST >/dev/null 2>/dev/null | |
montar pcsist $PCSIST; | |
echo "Montando compartilhamento 'tmp' em $TMP"; | |
desmontar $TMP >/dev/null 2>/dev/null | |
montar tmp $TMP | |
;; | |
"desmontar") | |
echo "Desmontando compartilhamentos" | |
echo "pcsist" | |
desmontar $PCSIST | |
echo "tmp" | |
desmontar $TMP | |
;; | |
esac; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment