#!/bin/bash # Exit the script on non-zero return code # Use `set +e` to override this when needing to compare return values set -e # Detect directory this script is running from, for relative imports DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # Fileserver to use for OS images, debootstrap files, and various others # Will be mounted using NFS FILESRV="se1.files.privex.io" # Exported NFS directory to mount FILESRV_EXPORT="/filesrv/web" # Local directory to mount NFS to NFSDIR="/mnt/nfs" [[ -d "$NFSDIR" ]] || mkdir -p "$NFSDIR" # If not already mounted, mount the NFS share grep -q "$FILESRV" /etc/mtab || mount -t nfs "${FILESRV}:${FILESRV_EXPORT}" "$NFSDIR"