#!/bin/bash # Filename: grml-chroot # Purpose: Program to chroot into another system # Authors: grml-team (grml.org), (c) Michael Gebetsroither # Bug-Reports: see http://grml.org/bugs/ # License: This file is licensed under the GPL v2. ################################################################################ PROG_NAME_=$(basename $0) DEST_="" MOUNTED_="" # all mounted destinations function die { echo "Error: $@" >&2 exit 1 } function printUsage { cat < "$DEST_"/etc/debian_chroot fi if (( $# < 1 )); then chroot "$DEST_" RC=$? else chroot "$DEST_" "$@" RC=$? fi umount_all if [ ! -z "$WROTE_DEBIAN_CHROOT" ]; then rm "$DEST_"/etc/debian_chroot fi exit $RC