windvn/path/wdvn-chroot
2022-08-17 07:13:04 +02:00

23 lines
335 B
Bash
Executable File

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