#!/bin/bash trap ctrl_c INT function ctrl_c() { wdvn-chroot-end "$1" exit 1 } ( set -e mount --bind -o x-gvfs-hide "/dev" "$1/dev" mount --bind -o x-gvfs-hide "/dev/pts" "$1/dev/pts" mount --bind -o x-gvfs-hide "/sys" "$1/sys" mount --bind -o x-gvfs-hide "/proc" "$1/proc" chroot "$1" ${@:2} ) if [ $? != 0 ]; then wdvn-chroot-end "$1" exit 1 fi wdvn-chroot-end "$1"