#!/bin/sh set -e || exit "$?" case "$ZSH_VERSION" in ?*) alias -g '${1+"$@"}'='"$@"';; esac prog_=; fs_=; fstype_=; opts_= unset prog_ fs_ fstype_ opts_ prog_=fsmount case "$#" in 0) echo "usage: $prog_ filesystem [options ...]" exit 100;; esac fs_="$1" shift case "$fs_" in */*);; *) fs_=/fs/"$fs_";; esac read fstype_ < "$fs_"/fstype || { echo >&2 "$prog_: $fs_: unable to read fstype" exit 100 } read opts_ < "$fs_"/mount-opts || { echo >&2 "$prog_: $fs_: unable to read mount-opts" exit 100 } opts_="defaults${opts_:+,$opts_}" case "$#" in 0);; *) opts_="$opts_,$1" shift;; esac exec minmount -t "$fstype_" -o "$opts_" "$fs_"/dev "$fs_"/mount ${1+"$@"}