#!/bin/bash CHROOT_PATH="/path/to/chroot" function noremount { if ! mount | grep -q "$2"; then echo "Mounting $1 into chroot" sudo mount --bind "$1" "$2" fi } noremount /dev/pts "${CHROOT_PATH}/dev/pts" noremount /proc "${CHROOT_PATH}/proc" exec nice -n 5 sudo chroot "$CHROOT_PATH" sudo -u root env EMAIL="$EMAIL" COLORFGBG="$COLORFGBG" bash -l