Sha256: e953b013e0066a118e629342222d350ef7e1aea352b2f76338994b6530d91a05

Contents?: true

Size: 426 Bytes

Versions: 123

Compression:

Stored size: 426 Bytes

Contents

#!/usr/bin/env ruby

require 'fileutils'
include FileUtils

dir = ARGV.shift or fail 'require directory to chroot into'
prg = ARGV.shift || '/bin/bash'
system "mount -t proc none #{dir}/proc"
system "mount -o bind /dev #{dir}/dev"
File.exist?(resolv = "#{dir}/etc/resolv.conf") and
  cp resolv, resolv + '.bak'
cp '/etc/resolv.conf', resolv
system "chroot #{dir} #{prg}"
system "umount #{dir}/proc"
system "umount #{dir}/dev"

Version data entries

123 entries across 123 versions & 1 rubygems

Version Path
utils-0.22.1 bin/chroot-exec
utils-0.22.0 bin/chroot-exec
utils-0.21.2 bin/chroot-exec
utils-0.21.1 bin/chroot-exec
utils-0.21.0 bin/chroot-exec
utils-0.20.0 bin/chroot-exec
utils-0.19.0 bin/chroot-exec
utils-0.18.1 bin/chroot-exec
utils-0.18.0 bin/chroot-exec
utils-0.17.0 bin/chroot-exec
utils-0.16.0 bin/chroot-exec
utils-0.15.1 bin/chroot-exec
utils-0.15.0 bin/chroot-exec
utils-0.14.0 bin/chroot-exec
utils-0.13.0 bin/chroot-exec
utils-0.12.0 bin/chroot-exec
utils-0.11.0 bin/chroot-exec
utils-0.10.1 bin/chroot-exec
utils-0.10.0 bin/chroot-exec
utils-0.9.0 bin/chroot-exec