Skip to content

Instantly share code, notes, and snippets.

@jmahlman
Last active November 19, 2019 06:48
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jmahlman/4261c3c0af2a9713802f8f7a469c4ff2 to your computer and use it in GitHub Desktop.
Save jmahlman/4261c3c0af2a9713802f8f7a469c4ff2 to your computer and use it in GitHub Desktop.
Automount a shared directory for use with backburner rendering
# make local "server" directory
SERVERDIR="/macsvr1"
if [ ! -e ${SERVERDIR} ]; then
mkdir ${SERVERDIR}
mkdir ${SERVERDIR}/Backburner
chmod -R 777 ${SERVERDIR}
else
echo "${SERVERDIR} already exsits, skipping."
fi
# add smb mount to auto_master
AUTOMASTER="/etc/auto_master"
if [ "$(grep "auto_smb" $AUTOMASTER)" != "/- auto_smb" ]; then
echo "Adding auto_smb to ${AUTOMASTER}"
echo "/- auto_smb" >> $AUTOMASTER
else
echo "auto_smb exists in ${AUTOMASTER}. Skipping auto_master setup."
fi
# create auto_smb file
AUTOSMB="/etc/auto_smb"
if [ ! -f ${AUTOSMB} ]; then
echo "Generating ${AUTOSMB}"
touch ${AUTOSMB}
echo "/macsvr1/Backburner -fstype=smbfs ://guest@macsvr1/Backburner" > $AUTOSMB
# re-check mounts
automount -vc
else
echo "Skipping generation of ${AUTOSMB}. Already exists."
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment