X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=usr_sbin%2Fgrml-chroot;h=4277c34e9036f2caa8d715c88f77f39153e233d2;hb=18f85c7883a8fccadf4292c693388e73f866d1b6;hp=7e5f50358ec4b0fde35fa80e12a5d7e935402b99;hpb=b78d9a653c75db151967d13ec6493016981950d5;p=grml-scripts-core.git diff --git a/usr_sbin/grml-chroot b/usr_sbin/grml-chroot index 7e5f503..4277c34 100755 --- a/usr_sbin/grml-chroot +++ b/usr_sbin/grml-chroot @@ -9,6 +9,7 @@ PROG_NAME_=$(basename $0) DEST_="" MOUNTED_="" # all mounted destinations +COMMAND_="" # command to start in chroot function die @@ -20,9 +21,9 @@ function die function printUsage { cat < +Usage: "$PROG_NAME_" NEWROOT [COMMAND....] -$PROG_NAME__ is a chroot wrapper with proc/sys/pts/dev fs handling +$PROG_NAME__ is a chroot wrapper with proc/sys/pts/dev filesystem handling EOT } @@ -78,6 +79,7 @@ if (( $# < 1 )); then fi DEST_="$1" +COMMAND_="${2}" if [ ! -d "$DEST_" ]; then die "Target chroot does not exist: $DEST_" @@ -87,5 +89,6 @@ fi mountit "proc" "proc" mountit "sysfs" "sys" mountit "/dev" "dev" "--bind" -chroot "$DEST_" /bin/bash +chroot "$DEST_" $COMMAND_ umount_all +