#!/bin/sh CHROOTS="/chroot/uclibc /chroot/base/hardened/x86 /chroot/default-linux/x86/2005.1 /chroot/2006.0 /chroot/base/hardened/x86/ssp4-test" BINDS="/dev /dev/pts /proc /usr/portage /sys" case "$1" in -l|--list) for chroot in ${CHROOTS}; do for bind in ${BINDS} ; do ( mount | grep "${bind} on ${chroot}${bind}" ) || echo \# ${bind} not bound to ${chroot} > /dev/stderr done echo done ;; -u|--umount) for bind in ${BINDS} ; do for chroot in ${CHROOTS}; do umount ${chroot}${bind} done done ;; -m|--mount) for bind in ${BINDS} ; do for chroot in ${CHROOTS}; do if [[ $(mount | grep "${bind} on ${chroot}${bind}") == "" ]]; then mount --bind ${bind} ${chroot}${bind} fi done done ;; *) echo "$0: <-u|-m|-l>" ;; esac