Last active
May 25, 2017 11:57
-
-
Save dandye/cd00638120a8dbdd159bac8cb9f61f1c to your computer and use it in GitHub Desktop.
VBox Shared Folder mount script
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 | |
# | |
# Mount a MacOS Directory via VirtualBox Shared Folder | |
# and open port 8000 for Django development server | |
# | |
# Args: | |
# ${1} mount name (optional; default: "edge_dev") | |
# | |
# Usage: | |
# sudo ./mount_edge.sh edge_dev | |
# sudo ./mount_edge.sh | |
DEFAULT_MOUNT_NAME="edge_dev" | |
MOUNT_NAME=${1:-$DEFAULT_MOUNT_NAME} | |
# TODO: | |
# 1. If target dir has contents, rename it. | |
# 2. If target dir doesn't exist, create it. | |
mount -t vboxsf \ | |
-o umask=002,gid=500,uid=501,rw \ | |
"${MOUNT_NAME}" \ | |
/usr/share/edge | |
iptables -A INPUT -p tcp -m tcp --dport 8000 -m state --state NEW -j ACCEPT | |
iptables -A INPUT -p tcp -m tcp --dport 8888 -m state --state NEW -j ACCEPT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment