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.87 bin/chroot-exec
utils-0.0.86 bin/chroot-exec
utils-0.0.85 bin/chroot-exec
utils-0.0.84 bin/chroot-exec
utils-0.0.83 bin/chroot-exec
utils-0.0.82 bin/chroot-exec
utils-0.0.81 bin/chroot-exec
utils-0.0.80 bin/chroot-exec
utils-0.0.79 bin/chroot-exec
utils-0.0.78 bin/chroot-exec
utils-0.0.77 bin/chroot-exec
utils-0.0.76 bin/chroot-exec
utils-0.0.75 bin/chroot-exec
utils-0.0.74 bin/chroot-exec
utils-0.0.73 bin/chroot-exec
utils-0.0.72 bin/chroot-exec
utils-0.0.71 bin/chroot-exec
utils-0.0.70 bin/chroot-exec
utils-0.0.69 bin/chroot-exec
utils-0.0.68 bin/chroot-exec