Skip to content

Instantly share code, notes, and snippets.

@ypresto
Last active August 29, 2015 14:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ypresto/80e32204df4354b9634a to your computer and use it in GitHub Desktop.
Save ypresto/80e32204df4354b9634a to your computer and use it in GitHub Desktop.
#!/bin/bash
# Place this on chroot target dir.
umount=0
[ "$1" = "-u" ] && umount=1
for dir in dev proc sys; do
if (( $umount )); then
umount ./$dir
else
mount -o bind /$dir ./$dir
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment