]> code.delx.au - monosys/blob - scripts/chroot
Renamed underscores to hyphens
[monosys] / scripts / chroot
1 #!/bin/bash
2
3 CHROOT_PATH="/path/to/chroot"
4
5 function noremount {
6 if ! mount | grep -q "$2"; then
7 echo "Mounting $1 into chroot"
8 sudo mount --bind "$1" "$2"
9 fi
10 }
11
12 noremount /dev/pts "${CHROOT_PATH}/dev/pts"
13 noremount /proc "${CHROOT_PATH}/proc"
14 exec nice -n 5 sudo chroot "$CHROOT_PATH" sudo -u root env EMAIL="$EMAIL" COLORFGBG="$COLORFGBG" bash -l
15