#!/bin/zsh if [ -z "$1" ] || [ -z "$2" ] ; then echo "Usage: sudo /usr/local/bin/$(basename $0) " echo "with in /gaf/self/tmp" exit -1 fi FILE=$(/usr/bin/readlink -m -n "$1") MNT=$(/usr/bin/readlink -m -n "$2") if ! [ -d $MNT ] ; then echo "$MNT is not a directory" exit -1 fi if ! [ -f $FILE ] ; then echo "$FILE does not exist" exit -1 fi if ! $(echo "$MNT" | egrep "^/gaf/self/tmp/[^\w]+") ; then echo "mountpoint not in /gaf/self/tmp" exit -1 fi /bin/mount -o loop,ro,nodev,noexec,nosuid "$FILE" "$MNT"