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.0.27 bin/chroot-exec
utils-0.0.26 bin/chroot-exec
utils-0.0.25 bin/chroot-exec
utils-0.0.24 bin/chroot-exec
utils-0.0.23 bin/chroot-exec
utils-0.0.22 bin/chroot-exec
utils-0.0.21 bin/chroot-exec
utils-0.0.20 bin/chroot-exec
utils-0.0.19 bin/chroot-exec
utils-0.0.18 bin/chroot-exec
utils-0.0.17 bin/chroot-exec
utils-0.0.16 bin/chroot-exec
utils-0.0.15 bin/chroot-exec
utils-0.0.14 bin/chroot-exec
utils-0.0.13 bin/chroot-exec
utils-0.0.12 bin/chroot-exec
utils-0.0.10 bin/chroot-exec
utils-0.0.8 bin/chroot-exec
utils-0.0.7 bin/chroot-exec
utils-0.0.6 bin/chroot-exec