문서의 이전 판입니다!
chroot 상태 확인
PS1 설정에 사용할것
from https://unix.stackexchange.com/questions/14345/how-do-i-tell-im-running-in-a-chroot
## stat - Display file or file system status.
##
## -c --format=FORMAT use the specified FORMAT instead of the default;
## output a newline after each use of FORMAT
##
## The valid format sequences for files (without --file-system):
## %d device number in decimal (st_dev)
## %i inode number
## 현재 root의 device, inode가 /sbin/init가 실행한 root와 동일한지 확인
if [ "$(stat -c %d:%i /)" != "$(stat -c %d:%i /proc/1/root/.)" ]; then
echo "We are chrooted!"
else
echo "Business as usual"
fi