Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # mychroot
- [[ ${#1} > 0 ]] && [[ -e /dev/$1 ]] && [[ $UID = 0 ]] ||\
- { echo "Usage (as root) - mychroot sdxy"; exit 1; }
- mount /dev/$1 /mnt/
- mps=(dev proc sys)
- for i in ${mps[@]}; do
- mount --bind /$i/ /mnt/$i/
- done
- chroot /mnt/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement