Aus VDR Wiki
#!/bin/bash
#
# script to start the vservers mountpoints,
# for more information see
# http://vdr.gentoo.de/wiki/index.php/VdrEbuildDevelopmentUmgebung
#
# by mad@cc.fh-lippe.de
#
if [ -z "$1" -o -z "$2" ]; then
echo "usage : vserver.sh name [start|stop]"
exit 1
fi
if [ ! -d "/vservers/$1" ]; then
echo "Sorry, no vserver dir!!"
exit 1
fi
case "$2" in
start)
mount --bind /proc /vservers/$1/proc
mount --bind /dev /vservers/$1/dev
mount --bind /var/lib/init.d /vservers/$1/var/lib/init.d/
#mount --bind /usr/portage /vservers/$1/usr/portage
#mount --bind /video /vservers/$1/video
chroot /vservers/$1 /bin/bash --login
;;
stop)
umount /vservers/$1/proc
umount /vservers/$1/dev
umount /var/lib/init.d /vservers/$1/var/lib/init.d/
#umount /vservers/$1/usr/portage
#umount /vservers/$1/video
echo "done."
;;
*)
echo "Usage: vserver.sh name [start|stop]"
exit 1
;;
esac