#!/bin/zsh # vim: ft=zsh noet ts=4 sts=4 sw=4 setopt extended_glob warn_create_global no_unset die() { print -r - "$@" >&2 exit 1 } vserver_name=${2:-${${PWD#/etc/vservers/}:h}} [[ -e /etc/vservers/$vserver_name ]] || \ die "$0:t could not determine vserver name" vdir=/etc/vservers/$vserver_name/vdir vdir=$vdir:A print -rl - >/var/run/vservers/$vserver_name.files /etc/vservers/$vserver_name/**/*(^@) grep >/var/run/vservers/$vserver_name.mtab '^[^ ]* '$vdir'[/ ]' /etc/mtab true # don't fail if grep matches nothing